From 2e9ae76596c87ff5b3f7d2b62a4892922090a2ca Mon Sep 17 00:00:00 2001 From: sconel Date: Mon, 10 May 2021 12:11:53 -0700 Subject: [PATCH] Removed print statement, adding in new files that were missed --- .../Registry/editorpreferences.setreg | 3 +- .../AzCore/Asset/SerializedAssetTracker.cpp | 29 ++++++++++++++++ .../AzCore/Asset/SerializedAssetTracker.h | 33 +++++++++++++++++++ .../Prefab/PrefabDomUtils.cpp | 4 +-- .../AzToolsFramework/Prefab/PrefabDomUtils.h | 3 +- .../Spawnable/PrefabCatchmentProcessor.cpp | 3 -- 6 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 Code/Framework/AzCore/AzCore/Asset/SerializedAssetTracker.cpp create mode 100644 Code/Framework/AzCore/AzCore/Asset/SerializedAssetTracker.h diff --git a/AutomatedTesting/Registry/editorpreferences.setreg b/AutomatedTesting/Registry/editorpreferences.setreg index d7afc9e0ae..b338d6acad 100644 --- a/AutomatedTesting/Registry/editorpreferences.setreg +++ b/AutomatedTesting/Registry/editorpreferences.setreg @@ -1,8 +1,7 @@ { "Amazon": { "Preferences": { - "EnablePrefabSystem": true, - "EnablePrefabSystemWipFeatures": true + "EnablePrefabSystem": false } } } \ No newline at end of file diff --git a/Code/Framework/AzCore/AzCore/Asset/SerializedAssetTracker.cpp b/Code/Framework/AzCore/AzCore/Asset/SerializedAssetTracker.cpp new file mode 100644 index 0000000000..b3fad2431f --- /dev/null +++ b/Code/Framework/AzCore/AzCore/Asset/SerializedAssetTracker.cpp @@ -0,0 +1,29 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include + +namespace AZ +{ + namespace Data + { + void SerializedAssetTracker::AddAsset(Asset& asset) + { + m_serializedAssets.emplace_back(asset); + } + + const AZStd::vector>& SerializedAssetTracker::GetTrackedAssets() const + { + return m_serializedAssets; + } + } +} diff --git a/Code/Framework/AzCore/AzCore/Asset/SerializedAssetTracker.h b/Code/Framework/AzCore/AzCore/Asset/SerializedAssetTracker.h new file mode 100644 index 0000000000..e1b0af72e1 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/Asset/SerializedAssetTracker.h @@ -0,0 +1,33 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +namespace AZ +{ + namespace Data + { + class SerializedAssetTracker + { + public: + AZ_RTTI(SerializedAssetTracker, "{1E067091-8C0A-44B1-A455-6E97663F6963}"); + + void AddAsset(Asset& asset); + const AZStd::vector>& GetTrackedAssets() const; + + private: + AZStd::vector> m_serializedAssets; + }; + } +} diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp index ae1737f907..9163b681de 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp @@ -118,7 +118,7 @@ namespace AzToolsFramework } bool LoadInstanceFromPrefabDom( - Instance& instance, const PrefabDom& prefabDom, AZStd::vector>& loadedAssets, LoadInstanceFlags flags) + Instance& instance, const PrefabDom& prefabDom, AZStd::vector>& referencedAssets, LoadInstanceFlags flags) { // When entities are rebuilt they are first destroyed. As a result any assets they were exclusively holding on to will // be released and reloaded once the entities are built up again. By suspending asset release temporarily the asset reload @@ -156,7 +156,7 @@ namespace AzToolsFramework return false; } - loadedAssets = assetTracker.GetTrackedAssets(); + referencedAssets = AZStd::move(assetTracker.GetTrackedAssets()); return true; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h index 1f000c2f70..c0992abda9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h @@ -76,7 +76,8 @@ namespace AzToolsFramework * @return bool on whether the operation succeeded. */ bool LoadInstanceFromPrefabDom( - Instance& instance, const PrefabDom& prefabDom, AZStd::vector>& loadedAssets, LoadInstanceFlags flags = LoadInstanceFlags::None); + Instance& instance, const PrefabDom& prefabDom, AZStd::vector>& referencedAssets, + LoadInstanceFlags flags = LoadInstanceFlags::None); /** * Loads a valid Prefab Instance from a Prefab Dom. Useful for generating Instances. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 9ae795dbf1..a89b364471 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -20,8 +20,6 @@ #include #include -#include - namespace AzToolsFramework::Prefab::PrefabConversionUtils { void PrefabCatchmentProcessor::Process(PrefabProcessorContext& context) @@ -65,7 +63,6 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZStd::move(uniqueName), context.GetSourceUuid(), AZStd::move(serializer)); AZ_Assert(spawnable, "Failed to create a new spawnable."); - Prefab::PrefabDomUtils::PrintPrefabDomValue("Prefab used for spawnable", prefab); bool result = SpawnableUtils::CreateSpawnable(*spawnable, prefab, object.GetReferencedAssets()); if (result) {