From 4fe43c81cf3e5d4b4afd329f470b351d27e04bc4 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:27:14 -0800 Subject: [PATCH] Removes ExporterFileProcessor from Gems/EMotionFX Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../CommandSystem/Source/ActorCommands.cpp | 1 - .../Source/AnimGraphCommands.cpp | 1 - .../CommandSystem/Source/MotionCommands.cpp | 1 - .../Source/MotionSetCommands.cpp | 1 - .../Exporter/ExporterFileProcessor.cpp | 127 ------------------ .../Exporter/ExporterFileProcessor.h | 46 ------- .../ExporterLib/exporterlib_files.cmake | 2 - .../Behaviors/ActorGroupBehavior.cpp | 1 + .../SceneAPIExt/Groups/MotionGroup.cpp | 1 - .../Code/EMotionFX/Source/MotionManager.h | 1 + 10 files changed, 2 insertions(+), 180 deletions(-) delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp delete mode 100644 Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp index ef573ab40c..fc22a81726 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorCommands.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp index b1a830c838..69a7068f58 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp index 2bec066549..5da75006dd 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionCommands.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp index 34fee273c2..08d1e62528 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MotionSetCommands.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include namespace CommandSystem diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp deleted file mode 100644 index 1d6687f135..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -// include the required headers -#include "ExporterFileProcessor.h" -#include "Exporter.h" -#include -#include -#include - - -namespace ExporterLib -{ -#define PREPARE_DISKFILE_SAVE(EXTENSION) \ - AZ::Debug::Timer saveTimer; \ - saveTimer.Stamp(); \ - if (filenameWithoutExtension.empty()) \ - { \ - MCore::LogError("Cannot save file. Empty FileName."); \ - return false; \ - } \ - AZStd::string extension; \ - AzFramework::StringFunc::Path::GetExtension(filenameWithoutExtension.c_str(), extension); \ - if (!extension.empty()) \ - { \ - AzFramework::StringFunc::Replace(filenameWithoutExtension, extension.c_str(), EXTENSION(), true, false, true); \ - } \ - else \ - { \ - filenameWithoutExtension += EXTENSION(); \ - } \ - \ - MCore::MemoryFile memoryFile; \ - memoryFile.Open(); \ - - -#define FINISH_DISKFILE_SAVE \ - bool result = memoryFile.SaveToDiskFile(filenameWithoutExtension.c_str()); \ - const float saveTime = saveTimer.GetDeltaTimeInSeconds() * 1000.0f; \ - MCore::LogInfo("Saved file '%s' in %.2f ms.", filenameWithoutExtension.c_str(), saveTime); \ - return result; - - - // constructor - Exporter::Exporter() - : EMotionFX::BaseObject() - { - } - - - // destructor - Exporter::~Exporter() - { - } - - - // create the exporter - Exporter* Exporter::Create() - { - return new Exporter(); - } - - - void Exporter::Delete() - { - delete this; - } - - - // make the memory file ready for saving - void Exporter::ResetMemoryFile(MCore::MemoryFile* file) - { - // make sure the file is valid - MCORE_ASSERT(file); - - // reset the incoming memory file - file->Close(); - file->Open(); - file->SetPreAllocSize(262144); // 256kB - file->Seek(0); - } - - - // actor - bool Exporter::SaveActor(MCore::MemoryFile* file, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType) - { - ResetMemoryFile(file); - ExporterLib::SaveActor(file, actor, targetEndianType); - return true; - } - - - bool Exporter::SaveActor(AZStd::string filenameWithoutExtension, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType) - { - PREPARE_DISKFILE_SAVE(GetActorExtension); - if (SaveActor(&memoryFile, actor, targetEndianType) == false) - { - return false; - } - FINISH_DISKFILE_SAVE - } - - - // skeletal motion - bool Exporter::SaveMotion(MCore::MemoryFile* file, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType) - { - ResetMemoryFile(file); - ExporterLib::SaveMotion(file, motion, targetEndianType); - return true; - } - - - bool Exporter::SaveMotion(AZStd::string filenameWithoutExtension, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType) - { - PREPARE_DISKFILE_SAVE(GetMotionExtension); - if (SaveMotion(&memoryFile, motion, targetEndianType) == false) - { - return false; - } - FINISH_DISKFILE_SAVE - } -} // namespace ExporterLib diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h deleted file mode 100644 index db1c6d4f3c..0000000000 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include - - -namespace ExporterLib -{ - class Exporter - : public EMotionFX::BaseObject - { - MCORE_MEMORYOBJECTCATEGORY(Exporter, EMFX_DEFAULT_ALIGNMENT, EMotionFX::EMFX_MEMCATEGORY_FILEPROCESSORS); - - public: - static Exporter* Create(); - - // actor - bool SaveActor(MCore::MemoryFile* file, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType); - bool SaveActor(AZStd::string filenameWithoutExtension, const EMotionFX::Actor* actor, MCore::Endian::EEndianType targetEndianType); - - // motion - bool SaveMotion(MCore::MemoryFile* file, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType); - bool SaveMotion(AZStd::string filenameWithoutExtension, EMotionFX::Motion* motion, MCore::Endian::EEndianType targetEndianType); - - private: - void ResetMemoryFile(MCore::MemoryFile* file); - - Exporter(); - virtual ~Exporter(); - - void Delete() override; - }; -} // namespace ExporterLib diff --git a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake index 8837238e3c..63e65fa1e2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/exporterlib_files.cmake @@ -10,8 +10,6 @@ set(FILES Exporter/EndianConversion.cpp Exporter/Exporter.h Exporter/ExporterActor.cpp - Exporter/ExporterFileProcessor.cpp - Exporter/ExporterFileProcessor.h Exporter/FileHeaderExport.cpp Exporter/MorphTargetExport.cpp Exporter/MotionEventExport.cpp diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp index d89e41f1a6..36173a2d2c 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Behaviors/ActorGroupBehavior.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp index e033d7ebb0..226a760292 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Pipeline/SceneAPIExt/Groups/MotionGroup.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h b/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h index 24c8c784f3..aa2c83aebe 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/MotionManager.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace EMotionFX {