Removes ExporterFileProcessor from Gems/EMotionFX

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-12-22 15:27:14 -08:00
parent bce3320fb5
commit 4fe43c81cf
10 changed files with 2 additions and 180 deletions
@@ -9,7 +9,6 @@
#include <EMotionFX/Source/Actor.h>
#include <EMotionFX/Source/EventManager.h>
#include <EMotionFX/Source/Recorder.h>
#include <EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h>
#include <EMotionFX/Exporters/ExporterLib/Exporter/Exporter.h>
#include <EMotionFX/Source/ActorManager.h>
#include <EMotionFX/Source/AnimGraphManager.h>
@@ -24,7 +24,6 @@
#include <EMotionFX/Source/MotionSystem.h>
#include <EMotionFX/Source/Recorder.h>
#include <EMotionFX/Source/Importer/Importer.h>
#include <EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h>
#include <AzFramework/API/ApplicationAPI.h>
@@ -20,7 +20,6 @@
#include <EMotionFX/Source/AnimGraphInstance.h>
#include <EMotionFX/Source/ActorManager.h>
#include <EMotionFX/Source/EventManager.h>
#include <EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h>
#include <EMotionFX/Exporters/ExporterLib/Exporter/Exporter.h>
#include <AzFramework/API/ApplicationAPI.h>
@@ -22,7 +22,6 @@
#include <EMotionFX/Source/AnimGraph.h>
#include <EMotionFX/Source/AnimGraphNode.h>
#include <EMotionFX/Source/AnimGraphMotionNode.h>
#include <EMotionFX/Exporters/ExporterLib/Exporter/ExporterFileProcessor.h>
#include <AzFramework/API/ApplicationAPI.h>
namespace CommandSystem
@@ -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 <AzCore/Debug/Timer.h>
#include <MCore/Source/LogManager.h>
#include <MCore/Source/StringConversions.h>
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
@@ -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 <AzCore/std/containers/vector.h>
#include <MCore/Source/Endian.h>
#include <EMotionFX/Source/AnimGraph.h>
#include <MCore/Source/MemoryFile.h>
#include <EMotionFX/Source/BaseObject.h>
#include <EMotionFX/Source/Motion.h>
#include <EMotionFX/Source/MotionSet.h>
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
@@ -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
@@ -9,6 +9,7 @@
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/std/algorithm.h>
#include <AzCore/std/smart_ptr/make_shared.h>
#include <AzToolsFramework/Debug/TraceContext.h>
#include <SceneAPI/SceneCore/Containers/Scene.h>
#include <SceneAPI/SceneCore/Containers/SceneGraph.h>
@@ -9,7 +9,6 @@
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzToolsFramework/Debug/TraceContext.h>
#include <SceneAPI/SceneCore/DataTypes/GraphData/IBoneData.h>
#include <SceneAPI/SceneCore/Utilities/Reporting.h>
#include <SceneAPI/SceneData/Rules/CoordinateSystemRule.h>
@@ -15,6 +15,7 @@
#include <MCore/Source/MultiThreadManager.h>
#include <EMotionFX/Source/BaseObject.h>
#include <EMotionFX/Source/EMotionFXConfig.h>
#include <EMotionFX/Source/MotionSet.h>
namespace EMotionFX
{