Prechádzať zdrojové kódy

Removed legacy unused export classes

Signed-off-by: Chris Galvan <[email protected]>
Chris Galvan 2 rokov pred
rodič
commit
2e6d31352e

+ 0 - 51
Code/Editor/Core/EditorActionsHandler.cpp

@@ -974,55 +974,6 @@ void EditorActionsHandler::OnActionRegistrationHook()
         m_actionManagerInterface->AssignModeToAction(AzToolsFramework::DefaultActionContextModeIdentifier, actionIdentifier);
     }
 
-    // Export Selected Objects
-    {
-        constexpr AZStd::string_view actionIdentifier = "o3de.action.game.exportSelectedObjects";
-        AzToolsFramework::ActionProperties actionProperties;
-        actionProperties.m_name = "Export Selected Objects";
-        actionProperties.m_description = "Export Selected Objects.";
-        actionProperties.m_category = "Game";
-        actionProperties.m_menuVisibility = AzToolsFramework::ActionVisibility::AlwaysShow;
-
-        m_actionManagerInterface->RegisterAction(
-            EditorIdentifiers::MainWindowActionContextIdentifier,
-            actionIdentifier,
-            actionProperties,
-            [cryEdit = m_cryEditApp]
-            {
-                cryEdit->OnExportSelectedObjects();
-            }
-        );
-
-        m_actionManagerInterface->InstallEnabledStateCallback(actionIdentifier, AreEntitiesSelected);
-        m_actionManagerInterface->AddActionToUpdater(EditorIdentifiers::EntitySelectionChangedUpdaterIdentifier, actionIdentifier);
-
-        // This action is only accessible outside of Component Modes
-        m_actionManagerInterface->AssignModeToAction(AzToolsFramework::DefaultActionContextModeIdentifier, actionIdentifier);
-    }
-
-    // Export Occlusion Mesh
-    {
-        constexpr AZStd::string_view actionIdentifier = "o3de.action.game.exportOcclusionMesh";
-        AzToolsFramework::ActionProperties actionProperties;
-        actionProperties.m_name = "Export Occlusion Mesh";
-        actionProperties.m_description = "Export Occlusion Mesh.";
-        actionProperties.m_category = "Game";
-        actionProperties.m_menuVisibility = AzToolsFramework::ActionVisibility::AlwaysShow;
-
-        m_actionManagerInterface->RegisterAction(
-            EditorIdentifiers::MainWindowActionContextIdentifier,
-            actionIdentifier,
-            actionProperties,
-            [cryEdit = m_cryEditApp]
-            {
-                cryEdit->OnFileExportOcclusionMesh();
-            }
-        );
-
-        // This action is only accessible outside of Component Modes
-        m_actionManagerInterface->AssignModeToAction(AzToolsFramework::DefaultActionContextModeIdentifier, actionIdentifier);
-    }
-
     // Move Player and Camera Separately
     {
         constexpr AZStd::string_view actionIdentifier = "o3de.action.game.movePlayerAndCameraSeparately";
@@ -1940,8 +1891,6 @@ void EditorActionsHandler::OnMenuBindingHook()
         }
         m_menuManagerInterface->AddActionToMenu(EditorIdentifiers::GameMenuIdentifier, "o3de.action.game.simulate", 200);
         m_menuManagerInterface->AddSeparatorToMenu(EditorIdentifiers::GameMenuIdentifier, 300);
-        m_menuManagerInterface->AddActionToMenu(EditorIdentifiers::GameMenuIdentifier, "o3de.action.game.exportSelectedObjects", 400);
-        m_menuManagerInterface->AddActionToMenu(EditorIdentifiers::GameMenuIdentifier, "o3de.action.game.exportOcclusionMesh", 500);
         m_menuManagerInterface->AddSeparatorToMenu(EditorIdentifiers::GameMenuIdentifier, 600);
         m_menuManagerInterface->AddActionToMenu(EditorIdentifiers::GameMenuIdentifier, "o3de.action.game.movePlayerAndCameraSeparately", 700);
         m_menuManagerInterface->AddSeparatorToMenu(EditorIdentifiers::GameMenuIdentifier, 800);

+ 0 - 6
Code/Editor/Core/LevelEditorMenuHandler.cpp

@@ -599,12 +599,6 @@ QMenu* LevelEditorMenuHandler::CreateGameMenu()
         gameMenu.AddAction(ID_FILE_EXPORTTOGAMENOSURFACETEXTURE);
     }
 
-    // Export Selected Objects
-    gameMenu.AddAction(ID_FILE_EXPORT_SELECTEDOBJECTS);
-
-    // Export Occlusion Mesh
-    gameMenu.AddAction(ID_FILE_EXPORTOCCLUSIONMESH);
-
     gameMenu.AddSeparator();
 
     // Synchronize Player with Camera

+ 0 - 35
Code/Editor/CryEdit.cpp

@@ -130,8 +130,6 @@ AZ_POP_DISABLE_WARNING
 
 #include "QuickAccessBar.h"
 
-#include "Export/ExportManager.h"
-
 #include "LevelFileDialog.h"
 #include "LevelIndependentFileMan.h"
 #include "WelcomeScreen/WelcomeScreenDialog.h"
@@ -365,7 +363,6 @@ void CCryEditApp::RegisterActionHandlers()
     ON_COMMAND(ID_DOCUMENTATION_GAMEDEVBLOG, OnDocumentationGameDevBlog)
     ON_COMMAND(ID_DOCUMENTATION_FORUMS, OnDocumentationForums)
     ON_COMMAND(ID_DOCUMENTATION_AWSSUPPORT, OnDocumentationAWSSupport)
-    ON_COMMAND(ID_FILE_EXPORT_SELECTEDOBJECTS, OnExportSelectedObjects)
     ON_COMMAND(ID_EDIT_HOLD, OnEditHold)
     ON_COMMAND(ID_EDIT_FETCH, OnEditFetch)
     ON_COMMAND(ID_FILE_EXPORTTOGAMENOSURFACETEXTURE, OnFileExportToGameNoSurfaceTexture)
@@ -421,7 +418,6 @@ void CCryEditApp::RegisterActionHandlers()
     ON_COMMAND(ID_OPEN_QUICK_ACCESS_BAR, OnOpenQuickAccessBar)
 
     ON_COMMAND(ID_FILE_SAVE_LEVEL, OnFileSave)
-    ON_COMMAND(ID_FILE_EXPORTOCCLUSIONMESH, OnFileExportOcclusionMesh)
 
     // Project Manager
     ON_COMMAND(ID_FILE_PROJECT_MANAGER_SETTINGS, OnOpenProjectManagerSettings)
@@ -2610,37 +2606,6 @@ void CCryEditApp::OnViewSwitchToGameFullScreen()
     OnViewSwitchToGame();
 }
 
-//////////////////////////////////////////////////////////////////////////
-void CCryEditApp::OnExportSelectedObjects()
-{
-    CExportManager* pExportManager = static_cast<CExportManager*> (GetIEditor()->GetExportManager());
-    QString filename = "untitled";
-    CBaseObject* pObj = GetIEditor()->GetSelectedObject();
-    if (pObj)
-    {
-        filename = pObj->GetName();
-    }
-    else
-    {
-        QString levelName = GetIEditor()->GetGameEngine()->GetLevelName();
-        if (!levelName.isEmpty())
-        {
-            filename = levelName;
-        }
-    }
-    QString levelPath = GetIEditor()->GetGameEngine()->GetLevelPath();
-    pExportManager->Export(filename.toUtf8().data(), "obj", levelPath.toUtf8().data());
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CCryEditApp::OnFileExportOcclusionMesh()
-{
-    CExportManager* pExportManager = static_cast<CExportManager*> (GetIEditor()->GetExportManager());
-    QString levelName = GetIEditor()->GetGameEngine()->GetLevelName();
-    QString levelPath = GetIEditor()->GetGameEngine()->GetLevelPath();
-    pExportManager->Export(levelName.toUtf8().data(), "ocm", levelPath.toUtf8().data(), false, false, true);
-}
-
 //////////////////////////////////////////////////////////////////////////
 void CCryEditApp::OnOpenAssetImporter()
 {

+ 0 - 3
Code/Editor/CryEdit.h

@@ -196,7 +196,6 @@ public:
     void OnDocumentationAWSSupport();
     void OnCommercePublish();
     void OnCommerceMerch();
-    void OnExportSelectedObjects();
     void OnEditHold();
     void OnEditFetch();
     void OnFileExportToGameNoSurfaceTexture();
@@ -395,8 +394,6 @@ private:
 public:
     void ExportLevel(bool bExportToGame, bool bExportTexture, bool bAutoExport);
     static bool Command_ExportToEngine();
-
-    void OnFileExportOcclusionMesh();
 };
 
 //////////////////////////////////////////////////////////////////////////

+ 0 - 1053
Code/Editor/Export/ExportManager.cpp

@@ -1,1053 +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 "ExportManager.h"
-
-// Qt
-#include <QMessageBox>
-
-// Maestro
-#include <Maestro/Types/AnimParamType.h>
-
-// Editor
-#include "ViewManager.h"
-#include "OBJExporter.h"
-#include "OCMExporter.h"
-#include "FBXExporterDialog.h"
-#include "TrackViewExportKeyTimeDlg.h"
-#include "AnimationContext.h"
-#include "TrackView/DirectorNodeAnimator.h"
-#include "Util/AutoDirectoryRestoreFileDialog.h"
-#include "QtUI/WaitCursor.h"
-#include "WaitProgress.h"
-#include "Objects/SelectionGroup.h"
-#include "Include/IObjectManager.h"
-#include "TrackView/TrackViewTrack.h"
-#include "TrackView/TrackViewSequenceManager.h"
-#include "Resource.h"
-#include "Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h"
-
-namespace
-{
-    const float kTangentDelta = 0.01f;
-    const float kAspectRatio = 1.777778f;
-    const int kReserveCount = 7; // x,y,z,rot_x,rot_y,rot_z,fov
-    const QString kPrimaryCameraName = "PrimaryCamera";
-} // namespace
-
-
-
-//////////////////////////////////////////////////////////
-// CMesh
-Export::CMesh::CMesh()
-{
-    ::ZeroMemory(&material, sizeof(material));
-    material.opacity = 1.0f;
-}
-
-
-//////////////////////////////////////////////////////////
-// CObject
-Export::CObject::CObject(const char* pName)
-    : m_MeshHash(0)
-{
-    pos.x = pos.y = pos.z = 0;
-    rot.v.x = rot.v.y = rot.v.z = 0;
-    rot.w = 1.0f;
-    scale.x = scale.y = scale.z = 1.0f;
-
-    nParent = -1;
-
-    azstrcpy(name, AZ_ARRAY_SIZE(name), pName);
-
-    materialName[0] = '\0';
-
-    entityType = Export::eEntity;
-
-    cameraTargetNodeName[0] = '\0';
-
-    m_pLastObject = nullptr;
-}
-
-
-void Export::CObject::SetMaterialName(const char* pName)
-{
-    azstrcpy(materialName, AZ_ARRAY_SIZE(materialName), pName);
-}
-
-
-// CExportData
-void Export::CData::Clear()
-{
-    m_objects.clear();
-}
-
-
-// CExportManager
-CExportManager::CExportManager()
-    : m_isPrecaching(false)
-    , m_fScale(100.0f)
-    , m_bAnimationExport(false)
-    , m_pBaseObj(nullptr)
-    ,                 // this scale is used by CryEngine RC
-    m_FBXBakedExportFPS(0.0f)
-    , m_bExportLocalCoords(false)
-    , m_bExportOnlyPrimaryCamera(false)
-    , m_numberOfExportFrames(0)
-    , m_pivotEntityObject(nullptr)
-    , m_bBakedKeysSequenceExport(true)
-    , m_animTimeExportPrimarySequenceCurrentTime(0.0f)
-    , m_animKeyTimeExport(true)
-    , m_soundKeyTimeExport(true)
-{
-    CExportManager::RegisterExporter(new COBJExporter());
-    CExportManager::RegisterExporter(new COCMExporter());
-}
-
-
-CExportManager::~CExportManager()
-{
-    m_data.Clear();
-    for (TExporters::iterator ppExporter = m_exporters.begin(); ppExporter != m_exporters.end(); ++ppExporter)
-    {
-        (*ppExporter)->Release();
-    }
-}
-
-
-bool CExportManager::RegisterExporter(IExporter* pExporter)
-{
-    if (!pExporter)
-    {
-        return false;
-    }
-
-    m_exporters.push_back(pExporter);
-    return true;
-}
-
-inline f32 Sandbox2MayaFOVDeg(const f32 fov, const f32 ratio) { return RAD2DEG(2.0f * atan_tpl(tan(DEG2RAD(fov) / 2.0f) * ratio)); };
-inline f32 Sandbox2MayaFOVRad2Deg(const f32 fov, const f32 ratio) { return RAD2DEG(2.0f * atan_tpl(tan(fov / 2.0f) * ratio)); };
-
-void CExportManager::AddEntityAnimationData(const CTrackViewTrack* pTrack, Export::CObject* pObj, AnimParamType entityTrackParamType)
-{
-    int keyCount = pTrack->GetKeyCount();
-    pObj->m_entityAnimData.reserve(keyCount * kReserveCount);
-
-    for (int keyNumber = 0; keyNumber < keyCount; keyNumber++)
-    {
-        const CTrackViewKeyConstHandle currentKeyHandle = pTrack->GetKey(keyNumber);
-        const float fCurrentKeytime = currentKeyHandle.GetTime();
-
-        float trackValue = 0.0f;
-        pTrack->GetValue(fCurrentKeytime, trackValue);
-
-        ISplineInterpolator* pSpline = pTrack->GetSpline();
-
-        if (pSpline)
-        {
-            Export::EntityAnimData entityData;
-            entityData.dataType = (Export::AnimParamType)pTrack->GetParameterType().GetType();
-            entityData.keyValue = trackValue;
-            entityData.keyTime = fCurrentKeytime;
-
-            if (entityTrackParamType == AnimParamType::Position)
-            {
-                entityData.keyValue *= 100.0f;
-            }
-            else if (entityTrackParamType == AnimParamType::FOV)
-            {
-                entityData.keyValue = Sandbox2MayaFOVDeg(entityData.keyValue, kAspectRatio);
-            }
-
-
-            ISplineInterpolator::ValueType tin;
-            ISplineInterpolator::ValueType tout;
-            ZeroStruct(tin);
-            ZeroStruct(tout);
-            pSpline->GetKeyTangents(keyNumber, tin, tout);
-
-            float fInTantentX = tin[0];
-            float fInTantentY = tin[1];
-
-            float fOutTantentX = tout[0];
-            float fOutTantentY = tout[1];
-
-            if (fInTantentX == 0.0f)
-            {
-                fInTantentX = kTangentDelta;
-            }
-
-            if (fOutTantentX == 0.0f)
-            {
-                fOutTantentX = kTangentDelta;
-            }
-
-            entityData.leftTangent = fInTantentY / fInTantentX;
-            entityData.rightTangent = fOutTantentY / fOutTantentX;
-
-            if (entityTrackParamType == AnimParamType::Position)
-            {
-                entityData.leftTangent *= 100.0f;
-                entityData.rightTangent *= 100.0f;
-            }
-
-            float fPrevKeyTime = 0.0f;
-            float fNextKeyTime = 0.0f;
-
-            bool bIsFirstKey = false;
-            bool bIsMiddleKey = false;
-            bool bIsLastKey = false;
-
-            if (keyNumber == 0 && keyNumber < (keyCount - 1))
-            {
-                const CTrackViewKeyConstHandle nextKeyHandle = pTrack->GetKey(keyNumber + 1);
-                fNextKeyTime = nextKeyHandle.GetTime();
-
-                if (fNextKeyTime != 0.0f)
-                {
-                    bIsFirstKey = true;
-                }
-            }
-            else if (keyNumber > 0)
-            {
-                const CTrackViewKeyConstHandle prevKeyHandle = pTrack->GetKey(keyNumber - 1);
-                fPrevKeyTime = prevKeyHandle.GetTime();
-
-                if (keyNumber < (keyCount - 1))
-                {
-                    const CTrackViewKeyConstHandle nextKeyHandle = pTrack->GetKey(keyNumber + 1);
-                    fNextKeyTime = nextKeyHandle.GetTime();
-
-                    if (fNextKeyTime != 0.0f)
-                    {
-                        bIsMiddleKey = true;
-                    }
-                }
-                else
-                {
-                    bIsLastKey = true;
-                }
-            }
-
-            float fLeftTangentWeightValue = 0.0f;
-            float fRightTangentWeightValue = 0.0f;
-
-            if (bIsFirstKey)
-            {
-                fRightTangentWeightValue = fOutTantentX / fNextKeyTime;
-            }
-            else if (bIsMiddleKey)
-            {
-                fLeftTangentWeightValue = fInTantentX / (fCurrentKeytime - fPrevKeyTime);
-                fRightTangentWeightValue = fOutTantentX / (fNextKeyTime - fCurrentKeytime);
-            }
-            else if (bIsLastKey)
-            {
-                fLeftTangentWeightValue = fInTantentX / (fCurrentKeytime - fPrevKeyTime);
-            }
-
-            entityData.leftTangentWeight = fLeftTangentWeightValue;
-            entityData.rightTangentWeight = fRightTangentWeightValue;
-
-            pObj->m_entityAnimData.push_back(entityData);
-        }
-    }
-}
-
-
-void CExportManager::ProcessEntityAnimationTrack(
-    const AZ::EntityId entityId, Export::CObject* pObj, AnimParamType entityTrackParamType)
-{
-    CTrackViewAnimNode* pEntityNode = GetIEditor()->GetSequenceManager()->GetActiveAnimNode(entityId);
-    CTrackViewTrack* pEntityTrack = (pEntityNode ? pEntityNode->GetTrackForParameter(entityTrackParamType) : nullptr);
-
-    if (!pEntityTrack)
-    {
-        return;
-    }
-
-    if (pEntityTrack->GetParameterType() == AnimParamType::FOV)
-    {
-        AddEntityAnimationData(pEntityTrack, pObj, entityTrackParamType);
-        return;
-    }
-
-    for (unsigned int trackNumber = 0; trackNumber < pEntityTrack->GetChildCount(); ++trackNumber)
-    {
-        CTrackViewTrack* pSubTrack = static_cast<CTrackViewTrack*>(pEntityTrack->GetChild(trackNumber));
-
-        if (pSubTrack)
-        {
-            AddEntityAnimationData(pSubTrack, pObj, entityTrackParamType);
-        }
-    }
-}
-
-
-void CExportManager::AddEntityAnimationData(AZ::EntityId entityId)
-{
-    Export::CObject* pObj = new Export::CObject(m_pBaseObj->GetName().toUtf8().data());
-
-    ProcessEntityAnimationTrack(entityId, pObj, AnimParamType::Position);
-    ProcessEntityAnimationTrack(entityId, pObj, AnimParamType::Rotation);
-}
-
-bool CExportManager::AddObject(CBaseObject* pBaseObj)
-{
-    if (m_isOccluder)
-    {
-        return false;
-    }
-
-    m_pBaseObj = pBaseObj;
-
-    if (m_bAnimationExport)
-    {
-        if (pBaseObj->GetType() == OBJTYPE_AZENTITY)
-        {
-            const auto componentEntityObject = static_cast<CComponentEntityObject*>(pBaseObj);
-            AddEntityAnimationData(componentEntityObject->GetAssociatedEntityId());
-            return true;
-        }
-    }
-
-    if (m_isPrecaching)
-    {
-        return true;
-    }
-
-    Export::CObject* pObj = new Export::CObject(m_pBaseObj->GetName().toUtf8().data());
-
-    AddPosRotScale(pObj, pBaseObj);
-    m_data.m_objects.push_back(pObj);
-
-    m_objectMap[pBaseObj] = int(m_data.m_objects.size() - 1);
-
-    m_pBaseObj = nullptr;
-
-    return true;
-}
-
-
-void CExportManager::AddPosRotScale(Export::CObject* pObj, const CBaseObject* pBaseObj)
-{
-    Vec3 pos = pBaseObj->GetPos();
-    pObj->pos.x = pos.x * m_fScale;
-    pObj->pos.y = pos.y * m_fScale;
-    pObj->pos.z = pos.z * m_fScale;
-
-    Quat rot = pBaseObj->GetRotation();
-    pObj->rot.v.x = rot.v.x;
-    pObj->rot.v.y = rot.v.y;
-    pObj->rot.v.z = rot.v.z;
-    pObj->rot.w = rot.w;
-
-    Vec3 scale = pBaseObj->GetScale();
-    pObj->scale.x = scale.x;
-    pObj->scale.y = scale.y;
-    pObj->scale.z = scale.z;
-}
-
-void CExportManager::AddEntityData(Export::CObject* pObj, Export::AnimParamType dataType, const float fValue, const float fTime)
-{
-    Export::EntityAnimData entityData;
-    entityData.dataType = dataType;
-    entityData.leftTangent = kTangentDelta;
-    entityData.rightTangent = kTangentDelta;
-    entityData.rightTangentWeight = 0.0f;
-    entityData.leftTangentWeight = 0.0f;
-    entityData.keyValue = fValue;
-    entityData.keyTime = fTime;
-    pObj->m_entityAnimData.push_back(entityData);
-}
-
-
-void CExportManager::SolveHierarchy()
-{
-    for (TObjectMap::iterator it = m_objectMap.begin(); it != m_objectMap.end(); ++it)
-    {
-        CBaseObject* pObj = it->first;
-        int index = it->second;
-        if (pObj && pObj->GetParent())
-        {
-            CBaseObject* pParent = pObj->GetParent();
-            TObjectMap::iterator itFind = m_objectMap.find(pParent);
-            if (itFind != m_objectMap.end())
-            {
-                int indexOfParent = itFind->second;
-                if (indexOfParent >= 0 && index >= 0)
-                {
-                    m_data.m_objects[index]->nParent = indexOfParent;
-                }
-            }
-        }
-    }
-
-    m_objectMap.clear();
-}
-
-bool CExportManager::ShowFBXExportDialog()
-{
-    CTrackViewSequence* pSequence = GetIEditor()->GetAnimation()->GetSequence();
-
-    if (!pSequence)
-    {
-        return false;
-    }
-
-    CFBXExporterDialog fpsDialog;
-
-    CTrackViewNode* pivotObjectNode = pSequence->GetFirstSelectedNode();
-
-    if (pivotObjectNode && !pivotObjectNode->IsGroupNode())
-    {
-        m_pivotEntityObject = static_cast<CEntityObject*>(GetIEditor()->GetObjectManager()->FindObject(pivotObjectNode->GetName().c_str()));
-
-        if (m_pivotEntityObject)
-        {
-            fpsDialog.SetExportLocalCoordsCheckBoxEnable(true);
-        }
-    }
-
-    if (fpsDialog.exec() != QDialog::Accepted)
-    {
-        return false;
-    }
-
-    SetFBXExportSettings(fpsDialog.GetExportCoordsLocalToTheSelectedObject(), fpsDialog.GetExportOnlyPrimaryCamera(), fpsDialog.GetFPS());
-
-    return true;
-}
-
-bool CExportManager::ProcessObjectsForExport()
-{
-    Export::CObject* pObj = new Export::CObject(kPrimaryCameraName.toUtf8().data());
-    pObj->entityType = Export::eCamera;
-    m_data.m_objects.push_back(pObj);
-
-    float fpsTimeInterval = 1.0f / m_FBXBakedExportFPS;
-    float timeValue = 0.0f;
-
-    GetIEditor()->GetAnimation()->SetRecording(false);
-    GetIEditor()->GetAnimation()->SetPlaying(false);
-
-    int startFrame = 0;
-    timeValue = startFrame * fpsTimeInterval;
-
-    for (int frameID = startFrame; frameID <= m_numberOfExportFrames; ++frameID)
-    {
-        GetIEditor()->GetAnimation()->SetTime(timeValue);
-
-        for (size_t objectID = 0; objectID < m_data.m_objects.size(); ++objectID)
-        {
-            Export::CObject* pObj2 =  m_data.m_objects[objectID];
-            CBaseObject* pObject = nullptr;
-
-            if (QString::compare(pObj2->name, kPrimaryCameraName) == 0)
-            {
-                pObject = GetIEditor()->GetObjectManager()->FindObject(GetIEditor()->GetViewManager()->GetCameraObjectId());
-            }
-            else
-            {
-                if (m_bExportOnlyPrimaryCamera && pObj2->entityType != Export::eCameraTarget)
-                {
-                    continue;
-                }
-
-                pObject = pObj2->GetLastObjectPtr();
-            }
-
-            if (!pObject)
-            {
-                continue;
-            }
-
-            Quat rotation(pObject->GetRotation());
-
-            if (pObject->GetParent())
-            {
-                CBaseObject* pParentObject = pObject->GetParent();
-                Quat parentWorldRotation;
-
-                const Vec3& parentScale = pParentObject->GetScale();
-                float threshold = 0.0003f;
-
-                bool bParentScaled = false;
-
-                if ((fabsf(parentScale.x - 1.0f) + fabsf(parentScale.y - 1.0f) + fabsf(parentScale.z - 1.0f)) >= threshold)
-                {
-                    bParentScaled = true;
-                }
-
-                if (bParentScaled)
-                {
-                    Matrix34 tm = pParentObject->GetWorldTM();
-                    tm.OrthonormalizeFast();
-                    parentWorldRotation = Quat(tm);
-                }
-                else
-                {
-                    parentWorldRotation = Quat(pParentObject->GetWorldTM());
-                }
-
-                rotation = parentWorldRotation * rotation;
-            }
-
-            Vec3 objectPos = pObject->GetWorldPos();
-
-            if (m_bExportLocalCoords && m_pivotEntityObject && m_pivotEntityObject != pObject)
-            {
-                Matrix34 currentObjectTM = pObject->GetWorldTM();
-                Matrix34 invParentTM = m_pivotEntityObject->GetWorldTM();
-                invParentTM.Invert();
-                currentObjectTM = invParentTM * currentObjectTM;
-
-                objectPos = currentObjectTM.GetTranslation();
-                rotation = Quat(currentObjectTM);
-            }
-
-            Ang3 worldAngles = RAD2DEG(Ang3::GetAnglesXYZ(Matrix33(rotation)));
-
-            Export::EntityAnimData entityData;
-            entityData.keyTime = timeValue;
-            entityData.leftTangentWeight = 0.0f;
-            entityData.rightTangentWeight = 0.0f;
-            entityData.leftTangent = 0.0f;
-            entityData.rightTangent = 0.0f;
-
-            entityData.keyValue = objectPos.x;
-            entityData.keyValue *= 100.0f;
-            entityData.dataType = (Export::AnimParamType)AnimParamType::PositionX;
-            pObj2->m_entityAnimData.push_back(entityData);
-
-            entityData.keyValue = objectPos.y;
-            entityData.keyValue *= 100.0f;
-            entityData.dataType = (Export::AnimParamType)AnimParamType::PositionY;
-            pObj2->m_entityAnimData.push_back(entityData);
-
-            entityData.keyValue = objectPos.z;
-            entityData.keyValue *= 100.0f;
-            entityData.dataType = (Export::AnimParamType)AnimParamType::PositionZ;
-            pObj2->m_entityAnimData.push_back(entityData);
-
-            entityData.keyValue = worldAngles.x;
-            entityData.dataType = (Export::AnimParamType)AnimParamType::RotationX;
-            pObj2->m_entityAnimData.push_back(entityData);
-
-            entityData.keyValue = worldAngles.y;
-            entityData.dataType = (Export::AnimParamType)AnimParamType::RotationY;
-            pObj2->m_entityAnimData.push_back(entityData);
-
-            entityData.dataType = (Export::AnimParamType)AnimParamType::RotationZ;
-            entityData.keyValue = worldAngles.z;
-            pObj2->m_entityAnimData.push_back(entityData);
-        }
-
-        timeValue += fpsTimeInterval;
-    }
-
-    return true;
-}
-
-bool CExportManager::IsDuplicateObjectBeingAdded(const QString& newObjectName)
-{
-    for (int objectID = 0; objectID < m_data.m_objects.size(); ++objectID)
-    {
-        if (newObjectName.compare(m_data.m_objects[objectID]->name, Qt::CaseInsensitive) == 0)
-        {
-            return true;
-        }
-    }
-
-    return false;
-}
-
-QString CExportManager::CleanXMLText(const QString& text)
-{
-    QString outText(text);
-    outText.replace("\\", "_");
-    outText.replace("/", "_");
-    outText.replace(" ", "_");
-    outText.replace(":", "-");
-    outText.replace(";", "-");
-    return outText;
-}
-
-void CExportManager::FillAnimTimeNode(XmlNodeRef writeNode, CTrackViewAnimNode* pObjectNode, [[maybe_unused]] CTrackViewSequence* currentSequence)
-{
-    if (!writeNode)
-    {
-        return;
-    }
-
-    CTrackViewTrackBundle allTracks = pObjectNode->GetAllTracks();
-    const unsigned int numAllTracks = allTracks.GetCount();
-    bool bCreatedSubNodes = false;
-
-    if (numAllTracks > 0)
-    {
-        XmlNodeRef objNode = writeNode->createNode(CleanXMLText(pObjectNode->GetName().c_str()).toUtf8().data());
-        writeNode->setAttr("time", m_animTimeExportPrimarySequenceCurrentTime);
-
-        for (unsigned int trackID = 0; trackID < numAllTracks; ++trackID)
-        {
-            CTrackViewTrack* childTrack = allTracks.GetTrack(trackID);
-
-            AnimParamType trackType = childTrack->GetParameterType().GetType();
-
-            if (trackType == AnimParamType::Animation || trackType == AnimParamType::Sound)
-            {
-                QString childName = CleanXMLText(childTrack->GetName().c_str());
-
-                if (childName.isEmpty())
-                {
-                    continue;
-                }
-
-                XmlNodeRef subNode = objNode->createNode(childName.toUtf8().data());
-                CTrackViewKeyBundle keyBundle = childTrack->GetAllKeys();
-                uint keysNumber = keyBundle.GetKeyCount();
-
-                for (uint keyID = 0; keyID < keysNumber; ++keyID)
-                {
-                    const CTrackViewKeyHandle& keyHandle = keyBundle.GetKey(keyID);
-
-                    QString keyContentName;
-                    float keyStartTime = 0.0f;
-                    float keyEndTime = 0.0f;
-                    ;
-                    float keyTime = 0.0f;
-                    float keyDuration = 0.0f;
-
-                    if (trackType == AnimParamType::Animation)
-                    {
-                        if (!m_animKeyTimeExport)
-                        {
-                            continue;
-                        }
-
-                        ICharacterKey animationKey;
-                        keyHandle.GetKey(&animationKey);
-                        keyStartTime = animationKey.m_startTime;
-                        keyEndTime = animationKey.m_endTime;
-                        keyTime = animationKey.time;
-                        keyContentName = CleanXMLText(animationKey.m_animation.c_str());
-                        keyDuration = animationKey.GetActualDuration();
-                    }
-                    else if (trackType == AnimParamType::Sound)
-                    {
-                        if (!m_soundKeyTimeExport)
-                        {
-                            continue;
-                        }
-
-                        ISoundKey soundKey;
-                        keyHandle.GetKey(&soundKey);
-                        keyTime = soundKey.time;
-                        keyContentName = CleanXMLText(soundKey.sStartTrigger.c_str());
-                        keyDuration = soundKey.fDuration;
-                    }
-
-                    if (keyContentName.isEmpty())
-                    {
-                        continue;
-                    }
-
-                    XmlNodeRef keyNode = subNode->createNode(keyContentName.toUtf8().data());
-
-                    float keyGlobalTime = m_animTimeExportPrimarySequenceCurrentTime + keyTime;
-                    keyNode->setAttr("keyTime", keyGlobalTime);
-
-                    if (keyStartTime > 0)
-                    {
-                        keyNode->setAttr("startTime", keyStartTime);
-                    }
-
-                    if (keyEndTime > 0)
-                    {
-                        keyNode->setAttr("endTime", keyEndTime);
-                    }
-
-                    if (keyDuration > 0)
-                    {
-                        keyNode->setAttr("duration", keyDuration);
-                    }
-
-                    subNode->addChild(keyNode);
-                    objNode->addChild(subNode);
-                    bCreatedSubNodes = true;
-                }
-            }
-        }
-
-        if (bCreatedSubNodes)
-        {
-            writeNode->addChild(objNode);
-        }
-    }
-}
-
-
-bool CExportManager::AddObjectsFromSequence(CTrackViewSequence* pSequence, XmlNodeRef seqNode)
-{
-    CTrackViewAnimNodeBundle allNodes = pSequence->GetAllAnimNodes();
-    const unsigned int numAllNodes = allNodes.GetCount();
-
-    for (unsigned int nodeID = 0; nodeID < numAllNodes; ++nodeID)
-    {
-        CTrackViewAnimNode* pAnimNode = allNodes.GetNode(nodeID);
-
-        if (seqNode && pAnimNode)
-        {
-            FillAnimTimeNode(seqNode, pAnimNode, pSequence);
-        }
-
-        AZ::Entity* entity = nullptr;
-        AZ::ComponentApplicationBus::BroadcastResult(
-            entity, &AZ::ComponentApplicationBus::Events::FindEntity, pAnimNode->GetAzEntityId());
-
-        if (entity)
-        {
-            QString addObjectName = entity->GetName().c_str();
-
-            if (IsDuplicateObjectBeingAdded(addObjectName))
-            {
-                continue;
-            }
-
-            Export::CObject* pObj = new Export::CObject(entity->GetName().c_str());
-
-            pObj->m_entityAnimData.reserve(m_numberOfExportFrames * kReserveCount);
-            m_data.m_objects.push_back(pObj);
-        }
-    }
-
-    CTrackViewTrackBundle trackBundle = pSequence->GetTracksByParam(AnimParamType::Sequence);
-
-    const uint numSequenceTracks = trackBundle.GetCount();
-    for (uint i = 0; i < numSequenceTracks; ++i)
-    {
-        CTrackViewTrack* pSequenceTrack = trackBundle.GetTrack(i);
-        if (pSequenceTrack->IsDisabled())
-        {
-            continue;
-        }
-
-        const uint numKeys = pSequenceTrack->GetKeyCount();
-        for (uint keyIndex = 0; keyIndex < numKeys; ++keyIndex)
-        {
-            const CTrackViewKeyHandle& keyHandle = pSequenceTrack->GetKey(keyIndex);
-            ISequenceKey sequenceKey;
-            keyHandle.GetKey(&sequenceKey);
-
-            CTrackViewSequence* pSubSequence = CDirectorNodeAnimator::GetSequenceFromSequenceKey(sequenceKey);
-
-            if (pSubSequence)
-            {
-                if (pSubSequence && !pSubSequence->IsDisabled())
-                {
-                    XmlNodeRef subSeqNode = nullptr;
-
-                    if (!seqNode)
-                    {
-                        AddObjectsFromSequence(pSubSequence);
-                    }
-                    else
-                    {
-                        // In case of exporting animation/sound times data
-                        const QString sequenceName = QString::fromUtf8(pSubSequence->GetName().c_str());
-                        XmlNodeRef subSeqNode2 = seqNode->createNode(sequenceName.toUtf8().data());
-
-                        if (sequenceName == m_animTimeExportPrimarySequenceName)
-                        {
-                            m_animTimeExportPrimarySequenceCurrentTime = sequenceKey.time;
-                        }
-                        else
-                        {
-                            m_animTimeExportPrimarySequenceCurrentTime += sequenceKey.time;
-                        }
-
-                        AddObjectsFromSequence(pSubSequence, subSeqNode2);
-                        seqNode->addChild(subSeqNode2);
-                    }
-                }
-            }
-        }
-    }
-
-    return false;
-}
-
-bool CExportManager::AddSelectedEntityObjects()
-{
-    CTrackViewSequence* pSequence = GetIEditor()->GetAnimation()->GetSequence();
-    if (!pSequence)
-    {
-        return false;
-    }
-
-    CTrackViewAnimNodeBundle selectedNodes = pSequence->GetSelectedAnimNodes();
-    const unsigned int numSelectedNodes = selectedNodes.GetCount();
-
-    for (unsigned int nodeNumber = 0; nodeNumber < numSelectedNodes; ++nodeNumber)
-    {
-        if (m_bAnimationExport)
-        {
-            CTrackViewAnimNode* pAnimNode = selectedNodes.GetNode(nodeNumber);
-            AddEntityAnimationData(pAnimNode->GetAzEntityId());
-        }
-    }
-
-    return true;
-}
-
-bool CExportManager::AddSelectedRegionObjects()
-{
-    AABB box;
-    GetIEditor()->GetSelectedRegion(box);
-    if (box.IsEmpty())
-    {
-        return false;
-    }
-
-    std::vector<CBaseObject*> objects;
-    GetIEditor()->GetObjectManager()->FindObjectsInAABB(box, objects);
-
-    const size_t numObjects = objects.size();
-    if (numObjects > m_data.m_objects.size())
-    {
-        m_data.m_objects.reserve(numObjects);
-    }
-    // First run pipeline to precache geometry
-    m_isPrecaching = true;
-    for (size_t i = 0; i < numObjects; ++i)
-    {
-        AddObject(objects[i]);
-    }
-
-    // Repeat pipeline to collect geometry
-    m_isPrecaching = false;
-    for (size_t i = 0; i < numObjects; ++i)
-    {
-        AddObject(objects[i]);
-    }
-
-    return true;
-}
-
-bool CExportManager::ExportToFile(const char* filename, bool bClearDataAfterExport)
-{
-    bool bRet = false;
-    QString ext = PathUtil::GetExt(filename);
-
-    if (m_data.GetObjectCount() == 0)
-    {
-        QMessageBox::warning(QApplication::activeWindow(), QString(), QObject::tr("Track View selection does not exist as an object."));
-        return false;
-    }
-
-    for (int i = 0; i < m_exporters.size(); ++i)
-    {
-        IExporter* pExporter = m_exporters[i];
-        if (!QString::compare(ext, pExporter->GetExtension(), Qt::CaseInsensitive))
-        {
-            bRet = pExporter->ExportToFile(filename, &m_data);
-            break;
-        }
-    }
-
-    if (bClearDataAfterExport)
-    {
-        m_data.Clear();
-    }
-    return bRet;
-}
-
-
-bool CExportManager::Export(const char* defaultName, const char* defaultExt, const char* defaultPath, [[maybe_unused]] bool isSelectedObjects, bool isSelectedRegionObjects, bool isOccluder, bool bAnimationExport)
-{
-    m_bAnimationExport = bAnimationExport;
-
-    m_isOccluder    =   isOccluder;
-    const float OldScale    =   m_fScale;
-    if (isOccluder)
-    {
-        m_fScale    =   1.f;
-    }
-
-    m_data.Clear();
-    m_objectMap.clear();
-
-    QString filters;
-    for (TExporters::iterator ppExporter = m_exporters.begin(); ppExporter != m_exporters.end(); ++ppExporter)
-    {
-        IExporter* pExporter = (*ppExporter);
-        if (pExporter)
-        {
-            const QString ext = pExporter->GetExtension();
-            const QString newFilter = QString("%1 (*.%2)").arg(pExporter->GetShortDescription(), ext);
-            if (filters.isEmpty())
-            {
-                filters = newFilter;
-            }
-            else if (ext == defaultExt) // the default extension should be the first item in the list, so it's the default export options
-            {
-                filters = newFilter + ";;" + filters;
-            }
-            else
-            {
-                filters = filters + ";;" + newFilter;
-            }
-        }
-    }
-    filters += ";;All files (*)";
-
-    bool returnRes = false;
-
-    QString newFilename(defaultName);
-    if (m_bAnimationExport || CFileUtil::SelectSaveFile(filters, defaultExt, defaultPath, newFilename))
-    {
-        WaitCursor wait;
-        if (isSelectedRegionObjects)
-        {
-            AddSelectedRegionObjects();
-        }
-
-        if (!bAnimationExport)
-        {
-            SolveHierarchy();
-        }
-
-        if (m_bAnimationExport)
-        {
-            CTrackViewSequence* pSequence = GetIEditor()->GetAnimation()->GetSequence();
-
-            if (pSequence)
-            {
-                // Save To FBX custom selected nodes
-                if (!m_bBakedKeysSequenceExport)
-                {
-                    returnRes = AddSelectedEntityObjects();
-                }
-                else
-                {
-                    // Export the whole sequence with baked keys
-                    if (ShowFBXExportDialog())
-                    {
-                        m_numberOfExportFrames = static_cast<int>(pSequence->GetTimeRange().end * m_FBXBakedExportFPS);
-
-                        if (!m_bExportOnlyPrimaryCamera)
-                        {
-                            AddObjectsFromSequence(pSequence);
-                        }
-
-                        returnRes = ProcessObjectsForExport();
-                        SolveHierarchy();
-                    }
-                }
-            }
-
-            if (returnRes)
-            {
-                returnRes = ExportToFile(defaultName);
-            }
-        }
-        else
-        {
-            returnRes = ExportToFile(newFilename.toStdString().c_str());
-        }
-    }
-
-    m_fScale = OldScale;
-    m_bBakedKeysSequenceExport = true;
-    m_FBXBakedExportFPS = 0.0f;
-
-    return returnRes;
-}
-
-void CExportManager::SetFBXExportSettings(bool bLocalCoordsToSelectedObject, bool bExportOnlyPrimaryCamera, const float fps)
-{
-    m_bExportLocalCoords = bLocalCoordsToSelectedObject;
-    m_bExportOnlyPrimaryCamera = bExportOnlyPrimaryCamera;
-    m_FBXBakedExportFPS = fps;
-}
-
-Export::Object* Export::CData::AddObject(const char* objectName)
-{
-    for (size_t objectID = 0; objectID < m_objects.size(); ++objectID)
-    {
-        if (strcmp(m_objects[objectID]->name, objectName) == 0)
-        {
-            return m_objects[objectID];
-        }
-    }
-
-    CObject* pObj = new CObject(objectName);
-    m_objects.push_back(pObj);
-    return m_objects[m_objects.size() - 1];
-}
-
-bool CExportManager::ImportFromFile(const char* filename)
-{
-    bool bRet = false;
-    QString ext = PathUtil::GetExt(filename);
-
-    m_data.Clear();
-
-    for (size_t handlerID = 0; handlerID < m_exporters.size(); ++handlerID)
-    {
-        IExporter* pExporter = m_exporters[handlerID];
-        if (!QString::compare(ext, pExporter->GetExtension(), Qt::CaseInsensitive))
-        {
-            bRet = pExporter->ImportFromFile(filename, &m_data);
-            break;
-        }
-    }
-
-    return bRet;
-}
-
-void CExportManager::SaveNodeKeysTimeToXML()
-{
-    CTrackViewSequence* pSequence = GetIEditor()->GetAnimation()->GetSequence();
-    if (!pSequence)
-    {
-        return;
-    }
-
-    CTrackViewExportKeyTimeDlg exportDialog;
-
-    if (exportDialog.exec() == QDialog::Accepted)
-    {
-        m_animKeyTimeExport = exportDialog.IsAnimationExportChecked();
-        m_soundKeyTimeExport = exportDialog.IsSoundExportChecked();
-
-        QString filters = "All files (*.xml)";
-        QString defaultName = QString::fromUtf8(pSequence->GetName().c_str()) + ".xml";
-
-        QtUtil::QtMFCScopedHWNDCapture cap;
-        CAutoDirectoryRestoreFileDialog dlg(QFileDialog::AcceptSave, QFileDialog::AnyFile, "xml", defaultName, filters, {}, {}, cap);
-        if (dlg.exec())
-        {
-            m_animTimeNode = XmlHelpers::CreateXmlNode(pSequence->GetName().c_str());
-            m_animTimeExportPrimarySequenceName = QString::fromUtf8(pSequence->GetName().c_str());
-
-            m_data.Clear();
-            m_animTimeExportPrimarySequenceCurrentTime = 0.0;
-
-            AddObjectsFromSequence(pSequence, m_animTimeNode);
-
-            m_animTimeNode->saveToFile(dlg.selectedFiles().constFirst().toStdString().c_str());
-            QMessageBox::information(QApplication::activeWindow(), QString(), QObject::tr("Export Finished"));
-        }
-    }
-}

+ 0 - 195
Code/Editor/Export/ExportManager.h

@@ -1,195 +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 : Manager for export geometry
-
-
-#ifndef CRYINCLUDE_EDITOR_EXPORT_EXPORTMANAGER_H
-#define CRYINCLUDE_EDITOR_EXPORT_EXPORTMANAGER_H
-#pragma once
-
-
-#include <AzCore/Component/EntityId.h>
-#include <IExportManager.h>
-
-class CExportManager;
-class CTrackViewTrack;
-class CTrackViewSequence;
-class CTrackViewAnimNode;
-class CEntityObject;
-
-typedef std::vector<IExporter*> TExporters;
-
-
-namespace Export
-{
-    class CMesh
-        : public Mesh
-        , public CRefCountBase
-    {
-    public:
-        CMesh();
-
-        int GetFaceCount() const override { return static_cast<int>(m_faces.size()); }
-        const Face* GetFaceBuffer() const override { return !m_faces.empty() ? &m_faces[0] : nullptr; }
-
-    private:
-        std::vector<Face> m_faces;
-
-        friend CExportManager;
-    };
-
-
-    class CObject
-        : public Object
-        , public CRefCountBase
-    {
-    public:
-        CObject(const char* pName);
-
-        int GetVertexCount() const override { return static_cast<int>(m_vertices.size()); }
-        const Vector3D* GetVertexBuffer() const override { return !m_vertices.empty() ? &m_vertices[0] : nullptr; }
-
-        int GetNormalCount() const override { return static_cast<int>(m_normals.size()); }
-        const Vector3D* GetNormalBuffer() const override { return !m_normals.empty() ? &m_normals[0] : nullptr; }
-
-        int GetTexCoordCount() const override { return static_cast<int>(m_texCoords.size()); }
-        const UV* GetTexCoordBuffer() const override { return !m_texCoords.empty() ? &m_texCoords[0] : nullptr; }
-
-        int GetMeshCount() const override { return static_cast<int>(m_meshes.size()); }
-        Mesh* GetMesh(int index) const override { return m_meshes[index]; }
-
-        size_t  MeshHash() const override{return m_MeshHash; }
-
-        void SetMaterialName(const char* pName);
-        int GetEntityAnimationDataCount() const override {return static_cast<int>(m_entityAnimData.size()); }
-        const EntityAnimData* GetEntityAnimationData(int index) const override {return &m_entityAnimData[index]; }
-        void SetEntityAnimationData(EntityAnimData entityData) override{ m_entityAnimData.push_back(entityData); };
-        void SetLastPtr(CBaseObject* pObject){m_pLastObject = pObject; };
-        CBaseObject* GetLastObjectPtr(){return m_pLastObject; };
-
-    private:
-        CBaseObject* m_pLastObject;
-        std::vector<Vector3D> m_vertices;
-        std::vector<Vector3D> m_normals;
-        std::vector<UV> m_texCoords;
-        std::vector< _smart_ptr<CMesh> > m_meshes;
-        std::vector<EntityAnimData> m_entityAnimData;
-
-        size_t  m_MeshHash;
-
-        friend CExportManager;
-    };
-
-
-    class CData
-        : public IData
-    {
-    public:
-        virtual ~CData() = default;
-
-        int GetObjectCount() const override { return static_cast<int>(m_objects.size()); }
-        Object* GetObject(int index) const override { return m_objects[index]; }
-        Object* AddObject(const char* objectName) override;
-        void Clear();
-
-    private:
-        std::vector< _smart_ptr<Export::CObject> > m_objects;
-
-        friend CExportManager;
-    };
-}
-
-
-typedef std::map<CBaseObject*, int> TObjectMap;
-
-class CExportManager
-    : public IExportManager
-{
-public:
-
-    CExportManager();
-    virtual ~CExportManager();
-
-    //! Register exporter
-    //! return true if succeed, otherwise false
-    bool RegisterExporter(IExporter* pExporter) override;
-
-    //! Export specified geometry
-    //! return true if succeed, otherwise false
-    bool Export(const char* defaultName, const char* defaultExt = "", const char* defaultPath = "", bool isSelectedObjects = true,
-        bool isSelectedRegionObjects = false, bool isOccluder = false, bool bAnimationExport = false);
-
-    bool AddSelectedEntityObjects();
-
-    //! Add to Export Data geometry from objects inside selected region volume
-    //! return true if succeed, otherwise false
-    bool AddSelectedRegionObjects();
-
-    //! Export to file collected data, using specified exporter throughout the file extension
-    //! return true if succeed, otherwise false
-    bool ExportToFile(const char* filename, bool bClearDataAfterExport = true);
-
-    bool ImportFromFile(const char* filename);
-    const Export::CData& GetData() const {return m_data; };
-
-    void SetBakedKeysSequenceExport(bool bBaked){m_bBakedKeysSequenceExport = bBaked; };
-
-    void SaveNodeKeysTimeToXML();
-
-private:
-    bool AddObject(CBaseObject* pBaseObj);
-    void SolveHierarchy();
-
-    void AddEntityAnimationData(AZ::EntityId entityId);
-    void ProcessEntityAnimationTrack(AZ::EntityId entityId, Export::CObject* pObj, AnimParamType entityTrackParamType);
-    void AddEntityAnimationData(const CTrackViewTrack* pTrack, Export::CObject* pObj, AnimParamType entityTrackParamType);
-
-    void AddPosRotScale(Export::CObject* pObj, const CBaseObject* pBaseObj);
-    void AddEntityData(Export::CObject* pObj, Export::AnimParamType dataType, const float fValue, const float fTime);
-
-    bool AddObjectsFromSequence(CTrackViewSequence* pSequence, XmlNodeRef seqNode = 0);
-    bool IsDuplicateObjectBeingAdded(const QString& newObject);
-    void SetFBXExportSettings(bool bLocalCoordsToSelectedObject, bool bExportOnlyPrimaryCamera, const float fps);
-    bool ProcessObjectsForExport();
-
-    bool ShowFBXExportDialog();
-
-    void FillAnimTimeNode(XmlNodeRef writeNode, CTrackViewAnimNode* pObjectNode, CTrackViewSequence* currentSequence);
-    QString CleanXMLText(const QString& text);
-
-private:
-
-    TExporters m_exporters;
-    Export::CData m_data;
-    bool m_isPrecaching;
-    bool m_isOccluder;
-    float m_fScale;
-    TObjectMap m_objectMap;
-    bool m_bAnimationExport;
-
-    CBaseObject* m_pBaseObj;
-
-    float m_FBXBakedExportFPS;
-    bool m_bExportLocalCoords;
-    bool m_bExportOnlyPrimaryCamera;
-    int m_numberOfExportFrames;
-    CEntityObject* m_pivotEntityObject;
-    bool m_bBakedKeysSequenceExport;
-
-    QString m_animTimeExportPrimarySequenceName;
-    float m_animTimeExportPrimarySequenceCurrentTime;
-    XmlNodeRef m_animTimeNode;
-
-    bool m_animKeyTimeExport;
-    bool m_soundKeyTimeExport;
-};
-
-
-#endif // CRYINCLUDE_EDITOR_EXPORT_EXPORTMANAGER_H

+ 0 - 284
Code/Editor/Export/OBJExporter.cpp

@@ -1,284 +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 "OBJExporter.h"
-
-
-const char* COBJExporter::GetExtension() const
-{
-    return "obj";
-}
-
-
-const char* COBJExporter::GetShortDescription() const
-{
-    return "Object files";
-}
-
-
-bool COBJExporter::ExportToFile(const char* filename, const Export::IData* pExportData)
-{
-    CLogFile::FormatLine("Exporting OBJ file to '%s'", filename);
-
-    FILE* hFile = nullptr;
-    azfopen(&hFile, filename, "w");
-    if (!hFile)
-    {
-        CLogFile::FormatLine("Error while opening file '%s'!", filename);
-        assert(hFile);
-        return false;
-    }
-
-    // Write header
-    fprintf(hFile, "# Object file exported by Sandbox\n");
-    fprintf(hFile, "# Attention: while import to 3DS Max Unify checkbox for normals must be unchecked.\n");
-    fprintf(hFile, "#\n");
-
-    // Create MTL library filename
-    QString materialFilename = filename;
-    materialFilename = Path::ReplaceExtension(materialFilename, "mtl");
-    materialFilename = Path::GetFile(materialFilename);
-
-    // Write material library import statement
-    fprintf(hFile, "mtllib %s\n", materialFilename.toUtf8().data());
-    fprintf(hFile, "#\n");
-
-    int numObjects = pExportData->GetObjectCount();
-    for (int i = 0; i < numObjects; ++i)
-    {
-        const Export::Object* pObj = pExportData->GetObject(i);
-
-        Vec3 pos(pObj->pos.x, pObj->pos.y, pObj->pos.z);
-        Quat rot(pObj->rot.w, pObj->rot.v.x, pObj->rot.v.y, pObj->rot.v.z);
-        Vec3 scale(pObj->scale.x, pObj->scale.y, pObj->scale.z);
-
-        Matrix34 tm = Matrix33::CreateScale(scale) * Matrix34(rot);
-        tm.SetTranslation(pos);
-
-        int nParent = pObj->nParent;
-        while (nParent >= 0 && nParent < pExportData->GetObjectCount())
-        {
-            const Export::Object* pParentObj = pExportData->GetObject(nParent);
-            assert(nullptr != pParentObj);
-
-            Vec3 pos2(pParentObj->pos.x, pParentObj->pos.y, pParentObj->pos.z);
-            Quat rot2(pParentObj->rot.w, pParentObj->rot.v.x, pParentObj->rot.v.y, pParentObj->rot.v.z);
-            Vec3 scale2(pParentObj->scale.x, pParentObj->scale.y, pParentObj->scale.z);
-
-            Matrix34 parentTm = Matrix33::CreateScale(scale2) * Matrix34(rot2);
-            parentTm.SetScale(scale2);
-            parentTm.SetTranslation(pos2);
-
-            tm = tm * parentTm;
-            nParent = pParentObj->nParent;
-        }
-
-        fprintf(hFile, "g %s\n", pObj->name); //For XSI
-        fprintf(hFile, "# object %s\n", pObj->name);
-        fprintf(hFile, "#\n");
-
-        int numVertices = pObj->GetVertexCount();
-        const Export::Vector3D* pVerts = pObj->GetVertexBuffer();
-
-        for (int ii = 0; ii < numVertices; ++ii)
-        {
-            const Export::Vector3D& vertex = pVerts[ii];
-
-            Vec3 vec(vertex.x, vertex.y, vertex.z);
-            vec = tm.TransformPoint(vec);
-
-            fprintf(hFile, "v %s %s %s\n", TrimFloat(vec.x), TrimFloat(vec.y), TrimFloat(vec.z));
-        }
-        fprintf(hFile, "# %i vertices\n\n", numVertices);
-
-        // Write object texture coordinates
-        int numTexCoords = pObj->GetTexCoordCount();
-        const Export::UV* pTexCoord = pObj->GetTexCoordBuffer();
-        for (int ii = 0; ii < numTexCoords; ++ii)
-        {
-            const Export::UV& textCoord = pTexCoord[ii];
-            fprintf(hFile, "vt %s %s 0\n", TrimFloat(textCoord.u), TrimFloat(textCoord.v));
-        }
-        fprintf(hFile, "# %i texture vertices\n\n", numTexCoords);
-
-        // Write object normals
-        int numNormals = pObj->GetNormalCount();
-        const Export::Vector3D* pNormals = pObj->GetNormalBuffer();
-        for (int ii = 0; ii < numNormals; ++ii)
-        {
-            const Export::Vector3D& normal = pNormals[ii];
-            fprintf(hFile, "vn %s %s %s\n", TrimFloat(normal.x), TrimFloat(normal.y), TrimFloat(normal.z));
-        }
-        fprintf(hFile, "# %i vertex normals\n\n", numNormals);
-
-
-        // Write submeshes
-        int numMeshes = pObj->GetMeshCount();
-        for (int j = 0; j < numMeshes; ++j)
-        {
-            const Export::Mesh* pMesh = pObj->GetMesh(j);
-            if (pMesh->material.name[0] != '\0')
-            {
-                fprintf(hFile, "usemtl %s\n", pMesh->material.name);
-            }
-
-            // TODO: if it's a smoth group fix it to bit difference
-            fprintf(hFile, "s %d\n", j);
-
-            // Write all faces, convert the indices to one based indices
-            int numFaces = pMesh->GetFaceCount();
-            const Export::Face* pFaceBuf = pMesh->GetFaceBuffer();
-            for (int ii = 0; ii < numFaces; ++ii)
-            {
-                const Export::Face& face = pFaceBuf[ii];
-                fprintf(hFile, "f %i/%i/%i %i/%i/%i %i/%i/%i\n",
-                    face.idx[0] - numVertices, face.idx[0] - numTexCoords, face.idx[0] - numNormals,
-                    face.idx[1] - numVertices, face.idx[1] - numTexCoords, face.idx[1] - numNormals,
-                    face.idx[2] - numVertices, face.idx[2] - numTexCoords, face.idx[2] - numNormals);
-            }
-            fprintf(hFile, "# %i faces\n\n", numFaces);
-        }
-    }
-
-    fprintf(hFile, "g\n");
-    fclose(hFile);
-
-
-    // Export Material
-    materialFilename = Path::ReplaceExtension(filename, "mtl");
-
-    // Open the material file
-    hFile = nullptr;
-    azfopen(&hFile, materialFilename.toUtf8().data(), "w");
-    if (!hFile)
-    {
-        CLogFile::FormatLine("Error while opening file '%s'!", materialFilename.toUtf8().data());
-        assert(hFile);
-        return false;
-    }
-
-    // Write header
-    fprintf(hFile, "# Material file exported by Sandbox\n\n");
-
-    for (int i = 0; i < numObjects; ++i)
-    {
-        const Export::Object* pObj = pExportData->GetObject(i);
-
-        int numMeshes = pObj->GetMeshCount();
-        for (int j = 0; j < numMeshes; j++)
-        {
-            const Export::Mesh* pMesh = pObj->GetMesh(j);
-            if (pMesh->material.name[0] != '\0')
-            {
-                // Write material
-                const Export::Material& mtl = pMesh->material;
-                fprintf(hFile, "newmtl %s\n", mtl.name);
-                fprintf(hFile, "Ka %s %s %s\n", TrimFloat(mtl.diffuse.r), TrimFloat(mtl.diffuse.g), TrimFloat(mtl.diffuse.b));
-                fprintf(hFile, "Kd %s %s %s\n", TrimFloat(mtl.diffuse.r), TrimFloat(mtl.diffuse.g), TrimFloat(mtl.diffuse.b));
-                fprintf(hFile, "Ks %s %s %s\n", TrimFloat(mtl.specular.r), TrimFloat(mtl.specular.g), TrimFloat(mtl.specular.b));
-                fprintf(hFile, "d %s\n", TrimFloat(1.0f - mtl.opacity));
-                fprintf(hFile, "Tr %s\n", TrimFloat(1.0f - mtl.opacity));
-                fprintf(hFile, "Ns %s\n", TrimFloat(mtl.smoothness));
-                if (strlen(mtl.mapDiffuse))
-                {
-                    fprintf(hFile, "map_Kd %s\n", MakeRelativePath(filename, mtl.mapDiffuse).toUtf8().constData());
-                }
-                if (strlen(mtl.mapSpecular))
-                {
-                    fprintf(hFile, "map_Ns %s\n", MakeRelativePath(filename, mtl.mapSpecular).toUtf8().constData());
-                }
-                if (strlen(mtl.mapOpacity))
-                {
-                    fprintf(hFile, "map_d %s\n", MakeRelativePath(filename, mtl.mapOpacity).toUtf8().constData());
-                }
-                if (strlen(mtl.mapNormals))
-                {
-                    fprintf(hFile, "bump %s\n", MakeRelativePath(filename, mtl.mapNormals).toUtf8().constData());
-                }
-                if (strlen(mtl.mapDecal))
-                {
-                    fprintf(hFile, "decal %s\n", MakeRelativePath(filename, mtl.mapDecal).toUtf8().constData());
-                }
-                if (strlen(mtl.mapDisplacement))
-                {
-                    fprintf(hFile, "disp %s\n", MakeRelativePath(filename, mtl.mapDisplacement).toUtf8().constData());
-                }
-                fprintf(hFile, "\n");
-            }
-        }
-    }
-
-    fclose(hFile);
-
-    return true;
-}
-
-
-QString COBJExporter::MakeRelativePath(const char* pMainFileName, const char* pFileName) const
-{
-    const char* ch = strrchr(pMainFileName, '\\');
-    if (ch)
-    {
-        if (strlen(pFileName) > static_cast<size_t>(ch - pMainFileName) && !_strnicmp(pMainFileName, pFileName, ch - pMainFileName))
-        {
-            return QString(pFileName + (ch - pMainFileName) + 1);
-        }
-    }
-
-    return QString(pFileName);
-}
-
-
-const char* COBJExporter::TrimFloat(float fValue) const
-{
-    // Convert a float into a string representation and remove all
-    // uneccessary zeroes and the decimal dot if it is not needed
-    const int nMaxAccessInTime = 4;
-
-    static char ppBufs[nMaxAccessInTime][16];
-    static int nCurBuf = 0;
-
-    if (nCurBuf >= nMaxAccessInTime)
-    {
-        nCurBuf = 0;
-    }
-
-    char* pBuf = ppBufs[nCurBuf];
-    size_t bufSize = sizeof(ppBufs[nCurBuf]);
-    ++nCurBuf;
-    sprintf_s(pBuf, bufSize, "%f", fValue);
-
-    for (int i = static_cast<int>(strlen(pBuf)) - 1; i > 0; --i)
-    {
-        if (pBuf[i] == '0')
-        {
-            pBuf[i] = 0;
-        }
-        else if (pBuf[i] == '.')
-        {
-            pBuf[i] = 0;
-            break;
-        }
-        else
-        {
-            break;
-        }
-    }
-
-    return pBuf;
-}
-
-
-
-void COBJExporter::Release()
-{
-    delete this;
-}

+ 0 - 37
Code/Editor/Export/OBJExporter.h

@@ -1,37 +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 : Export geometry OBJ file format
-
-
-#ifndef CRYINCLUDE_EDITOR_EXPORT_OBJEXPORTER_H
-#define CRYINCLUDE_EDITOR_EXPORT_OBJEXPORTER_H
-#pragma once
-
-
-#include <IExportManager.h>
-
-
-class COBJExporter
-    : public IExporter
-{
-public:
-    virtual const char* GetExtension() const;
-    virtual const char* GetShortDescription() const;
-    virtual bool ExportToFile(const char* filename, const Export::IData* pExportData);
-    virtual bool ImportFromFile([[maybe_unused]] const char* filename, [[maybe_unused]] Export::IData* pData){return false; };
-    virtual void Release();
-
-private:
-    const char* TrimFloat(float fValue) const;
-    QString MakeRelativePath(const char* pMainFileName, const char* pFileName) const;
-};
-
-
-#endif // CRYINCLUDE_EDITOR_EXPORT_OBJEXPORTER_H

+ 0 - 291
Code/Editor/Export/OCMExporter.cpp

@@ -1,291 +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 "OCMExporter.h"
-
-
-class CFileEndianWriter
-{
-    std::vector<uint8>              m_Data;
-    size_t                                      m_Offset;
-public:
-    CFileEndianWriter()
-        : m_Offset(0){}
-    void                                            Seek(size_t Offset){m_Offset = Offset; }
-    void                                            Write(const void* pData, size_t Size)
-    {
-        if (m_Offset + Size > m_Data.size())
-        {
-            m_Data.resize(m_Offset + Size);
-        }
-        memcpy(&m_Data[m_Offset], pData, Size);
-        m_Offset += Size;
-    }
-    size_t                                      Pos() const{return m_Offset; }
-    template<size_t Padding>
-    void                                            Align(){m_Offset = (m_Offset + (Padding - 1)) & ~(Padding - 1); }
-    template<class T>
-    void                                            Write(T D){Write(&D, sizeof(T)); }
-
-
-    const std::vector<uint8>&   Data() const{return m_Data; }
-};
-
-const char* COCMExporter::GetExtension() const
-{
-    return "ocm";
-}
-
-const char* COCMExporter::GetShortDescription() const
-{
-    return "occlusion culler mesh";
-}
-
-Matrix44 MatRotate(f32 a, f32 b, f32 g)
-{
-    const f32   CosR    =   cosf(a);
-    const f32   SinR    =   sinf(a);
-    const f32   CosP    =   cosf(b);
-    const f32   SinP    =   sinf(b);
-    const f32   CosY    =   cosf(g);
-    const f32   SinY    =   sinf(g);
-    const f32   SRSP    =   SinR * SinP;
-    const f32   CRSP    =   CosR * SinP;
-
-    Matrix44 Mat;
-    Mat.m00 = CosP * CosY;
-    Mat.m01 = CosP * SinY;
-    Mat.m02 = -SinP;
-    Mat.m03 = 0.f;
-    Mat.m10 = SRSP * CosY - CosR * SinY;
-    Mat.m11 = SRSP * SinY + CosR * CosY;
-    Mat.m12 = SinR * CosP;
-    Mat.m13 = 0.f;
-    Mat.m20 = CRSP * CosY + SinR * SinY;
-    Mat.m21 = CRSP * SinY - SinR * CosY;
-    Mat.m22 = CosR * CosP;
-    Mat.m23 = 0.f;
-    Mat.m30 = 0.f;
-    Mat.m31 = 0.f;
-    Mat.m32 = 0.f;
-    Mat.m33 = 1.f;
-    return Mat;
-};
-
-void COCMExporter::Extends(const Matrix44& rTransform, const Export::Object* pMesh, f32& rMinX, f32& rMaxX, f32& rMinY, f32& rMaxY, f32& rMinZ, f32& rMaxZ)    const
-{
-    rMinX = rMinY = rMinZ   =   FLT_MAX;
-    rMaxX = rMaxY = rMaxZ   =   -FLT_MAX;
-    const uint32 TriCount   =   pMesh->GetVertexCount();
-    const Export::Vector3D* pVerts = pMesh->GetVertexBuffer();
-    for (size_t a = 0; a < TriCount; a++)
-    {
-        const Export::Vector3D& rV = pVerts[a];
-        const Vec3  VO(rV.x, rV.y, rV.z);
-        const Vec3  V   =   rTransform.TransformPoint(VO);
-        rMinX   =   std::min(rMinX, V.x);
-        rMinY   =   std::min(rMinY, V.y);
-        rMinZ   =   std::min(rMinZ, V.z);
-        rMaxX   =   std::max(rMaxX, V.x);
-        rMaxY   =   std::max(rMaxY, V.y);
-        rMaxZ   =   std::max(rMaxZ, V.z);
-    }
-}
-
-Matrix44 COCMExporter::CalcOBB(const Export::Object* pMesh)
-{
-    Matrix44 OBBMat(IDENTITY);
-    f32 MinX, MaxX, MinY, MaxY, MinZ, MaxZ;
-    Extends(OBBMat, pMesh, MinX, MaxX, MinY, MaxY, MinZ, MaxZ);
-
-    OBBMat.m03  =   -(MaxX + MinX) * 0.5f;
-    OBBMat.m13  =   -(MaxY + MinY) * 0.5f;
-    OBBMat.m23  =   -(MaxZ + MinZ) * 0.5f;
-
-    return OBBMat;
-}
-
-size_t COCMExporter::SaveMesh(CFileEndianWriter& rWriter, const Export::Object* pMesh, Matrix44& rOBBMat)
-{
-    const size_t PosStart   =   rWriter.Pos();
-    rOBBMat =   CalcOBB(pMesh);
-    const Export::Vector3D* pVerts = pMesh->GetVertexBuffer();
-    std::vector<float> Pos;
-    const uint32 SubMeshCount = pMesh->GetMeshCount();
-    for (uint32 b = 0; b < SubMeshCount; b++)
-    {
-        const Export::Mesh* pSubMesh = pMesh->GetMesh(b);
-        const uint32 FaceCount  = pSubMesh->GetFaceCount();
-        const Export::Face* pFaces = pSubMesh->GetFaceBuffer();
-        Pos.reserve(Pos.size() + FaceCount * 9);
-        for (size_t a = 0; a < FaceCount; a++)
-        {
-            const Export::Vector3D& rV0 = pVerts[pFaces[a].idx[0]];
-            const Export::Vector3D& rV1 = pVerts[pFaces[a].idx[1]];
-            const Export::Vector3D& rV2 = pVerts[pFaces[a].idx[2]];
-            const Vec3  VO0(rV0.x, rV0.y, rV0.z);
-            const Vec3  VO1(rV1.x, rV1.y, rV1.z);
-            const Vec3  VO2(rV2.x, rV2.y, rV2.z);
-            const Vec3  V0  =   rOBBMat.TransformPoint(VO0);
-            const Vec3  V1  =   rOBBMat.TransformPoint(VO1);
-            const Vec3  V2  =   rOBBMat.TransformPoint(VO2);
-            const Vec3  N   =   (V2 - V0).cross(V1 - V0);
-            if (fabsf(N.dot(N)) <= FLT_EPSILON)//degenerated?
-            {
-                continue;
-            }
-            Pos.push_back(V0.x);
-            Pos.push_back(V0.y);
-            Pos.push_back(V0.z);
-            Pos.push_back(1.f);
-            Pos.push_back(V1.x);
-            Pos.push_back(V1.y);
-            Pos.push_back(V1.z);
-            Pos.push_back(1.f);
-            Pos.push_back(V2.x);
-            Pos.push_back(V2.y);
-            Pos.push_back(V2.z);
-            Pos.push_back(1.f);
-        }
-    }
-    const uint32 TriCount       =   static_cast<uint16>(std::min<size_t>(65535, Pos.size() / 4));//vertex count at 4float/vertex
-    rWriter.Write(TriCount);
-    rWriter.Align<16>();
-    rWriter.Write(&Pos[0], 4 * TriCount * sizeof(float));
-    rWriter.Align<4>();
-    const size_t PosEnd =   rWriter.Pos();
-    return PosEnd - PosStart;//sizeof(TriCount)+sizeof(Pos[0])*Pos.size();
-}
-
-void COCMExporter::SaveInstance(CFileEndianWriter& rWriter, const Export::Object* pInstance, const SOCMeshInfo& rMeshInfo)
-{
-    Vec3 pos(pInstance->pos.x, pInstance->pos.y, pInstance->pos.z);
-    Quat rot(pInstance->rot.w, pInstance->rot.v.x, pInstance->rot.v.y, pInstance->rot.v.z);
-    Vec3 scale(pInstance->scale.x, pInstance->scale.y, pInstance->scale.z);
-
-    Matrix44 tm = Matrix33::CreateScale(scale) * Matrix34(rot);
-    tm.SetTranslation(pos);
-
-    tm  =   tm * rMeshInfo.m_OBBMat.GetInverted();
-
-    //const uint32 MeshID   =   pInstance->MeshToUse()->ID();
-    rWriter.Write(rMeshInfo.m_Offset);
-    for (size_t a = 0; a < 12; a++)//just savin the 3x4 matrix
-    {
-        rWriter.Write(*(reinterpret_cast<float*>(&tm) + a));
-    }
-}
-
-bool COCMExporter::ExportToFile(const char* filename, const Export::IData* pExportData)
-{
-    CLogFile::FormatLine("Exporting OCM file to '%s'", filename);
-
-    FILE* pFile = nullptr;
-    azfopen(&pFile, filename, "wb");
-    if (!pFile)
-    {
-        CLogFile::FormatLine("Error while opening file '%s'!", filename);
-        assert(pFile);
-        return false;
-    }
-
-    CFileEndianWriter Writer;
-    // Write header
-    const uint32 Version        =   ~(4u << 24);
-    const uint32 MeshCount  =   pExportData->GetObjectCount();
-    const uint32 InstCount  =   pExportData->GetObjectCount();
-    uint32  OffsetInstances =   0;
-    Writer.Write(Version);
-    Writer.Write(MeshCount);
-    Writer.Write(InstCount);
-    Writer.Write(OffsetInstances);//keep header end aligned to 16byte
-
-    tdMeshOffset    MeshOffsets;
-    MeshOffsets.reserve(MeshCount);
-    size_t Offset = 16;
-    //std::map<void*,size_t> MeshO
-    for (size_t a = 0; a < MeshCount; a++)
-    {
-        SOCMeshInfo MeshInfo;
-        MeshInfo.m_MeshHash =    pExportData->GetObject(static_cast<int>(a))->MeshHash();
-        const tdMeshOffset::iterator it =   std::find(MeshOffsets.begin(), MeshOffsets.end(), MeshInfo);
-        if (it != MeshOffsets.end())
-        {
-            MeshInfo    =   *it;
-        }
-        else
-        {
-            MeshInfo.m_Offset   = static_cast<uint32>(Offset);
-            Offset += SaveMesh(Writer, pExportData->GetObject(static_cast<int>(a)), MeshInfo.m_OBBMat);
-        }
-        MeshOffsets.push_back(MeshInfo);
-    }
-    OffsetInstances =   static_cast<uint32>(Offset);
-    for (size_t a = 0; a < InstCount; a++)
-    {
-        SaveInstance(Writer, pExportData->GetObject(static_cast<int>(a)), MeshOffsets[a]);
-    }
-    Writer.Seek(4);
-    Writer.Write(static_cast<uint32>(MeshOffsets.size()));
-    Writer.Seek(12);
-    Writer.Write(OffsetInstances);
-
-    fwrite(&Writer.Data()[0], 1, Writer.Data().size(), pFile);
-
-    fclose(pFile);
-    return true;
-}
-
-const char* COCMExporter::TrimFloat(float fValue) const
-{
-    // Convert a float into a string representation and remove all
-    // unnecessary zeros and the decimal dot if it is not needed
-    const int nMaxAccessInTime = 4;
-
-    static char ppBufs[nMaxAccessInTime][16];
-    static int nCurBuf = 0;
-
-    if (nCurBuf >= nMaxAccessInTime)
-    {
-        nCurBuf = 0;
-    }
-
-    char* pBuf = ppBufs[nCurBuf];
-    size_t bufSize = sizeof(ppBufs[nCurBuf]);
-    ++nCurBuf;
-    sprintf_s(pBuf, bufSize, "%f", fValue);
-
-    for (int i = static_cast<int>(strlen(pBuf)) - 1; i > 0; --i)
-    {
-        if (pBuf[i] == '0')
-        {
-            pBuf[i] = 0;
-        }
-        else if (pBuf[i] == '.')
-        {
-            pBuf[i] = 0;
-            break;
-        }
-        else
-        {
-            break;
-        }
-    }
-
-    return pBuf;
-}
-
-
-
-void COCMExporter::Release()
-{
-    delete this;
-}

+ 0 - 50
Code/Editor/Export/OCMExporter.h

@@ -1,50 +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 : Export geometry OCM file format
-
-
-#ifndef CRYINCLUDE_EDITOR_EXPORT_OCMEXPORTER_H
-#define CRYINCLUDE_EDITOR_EXPORT_OCMEXPORTER_H
-#pragma once
-
-#include <IExportManager.h>
-
-class CFileEndianWriter;
-
-struct SOCMeshInfo
-{
-    Matrix44    m_OBBMat;
-    uint32      m_Offset;
-    size_t      m_MeshHash;
-    bool    operator==(const SOCMeshInfo& rOther) const{return m_MeshHash == rOther.m_MeshHash; }
-};
-typedef std::vector<SOCMeshInfo>    tdMeshOffset;
-
-class COCMExporter
-    : public IExporter
-{
-public:
-    virtual const char* GetExtension() const;
-    virtual const char* GetShortDescription() const;
-    virtual bool ExportToFile(const char* filename, const Export::IData* pExportData);
-    virtual bool ImportFromFile([[maybe_unused]] const char* filename, [[maybe_unused]] Export::IData* pData){return false; };
-    virtual void Release();
-
-private:
-    const char* TrimFloat(float fValue) const;
-    void SaveInstance(CFileEndianWriter& rWriter, const Export::Object* pInstance, const SOCMeshInfo& rMeshInfo);
-    size_t SaveMesh(CFileEndianWriter& rWriter, const Export::Object* pMesh, Matrix44& rOBBMat);
-
-    void Extends(const Matrix44& rTransform, const Export::Object* pMesh, f32& rMinX, f32& rMaxX, f32& rMinY, f32& rMaxY, f32& rMinZ, f32& rMaxZ)  const;
-    Matrix44 CalcOBB(const Export::Object* pMesh);
-};
-
-
-#endif // CRYINCLUDE_EDITOR_EXPORT_OCMEXPORTER_H

+ 0 - 24
Code/Editor/GameExporter.cpp

@@ -178,7 +178,6 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE
             ////////////////////////////////////////////////////////////////////////
             // Exporting map setttings
             ////////////////////////////////////////////////////////////////////////
-            ExportOcclusionMesh(sLevelPath.toUtf8().data());
 
             //! Export Level data.
             CLogFile::WriteLine("Exporting leveldata.xml");
@@ -235,29 +234,6 @@ bool CGameExporter::Export(unsigned int flags, [[maybe_unused]] EEndian eExportE
     return exportSuccessful;
 }
 
-//////////////////////////////////////////////////////////////////////////
-void CGameExporter::ExportOcclusionMesh(const char* pszGamePath)
-{
-    IEditor* pEditor = GetIEditor();
-    pEditor->SetStatusText(QObject::tr("including Occluder Mesh \"occluder.ocm\" if available"));
-
-    char resolvedLevelPath[AZ_MAX_PATH_LEN] = { 0 };
-    AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath(pszGamePath, resolvedLevelPath, AZ_MAX_PATH_LEN);
-    QString levelDataFile = QString(resolvedLevelPath) + "occluder.ocm";
-    QFile FileIn(levelDataFile);
-    if (FileIn.open(QFile::ReadOnly))
-    {
-        CMemoryBlock Temp;
-        const size_t Size   =   FileIn.size();
-        Temp.Allocate(static_cast<int>(Size));
-        FileIn.read(reinterpret_cast<char*>(Temp.GetBuffer()), Size);
-        FileIn.close();
-        CCryMemFile FileOut;
-        FileOut.Write(Temp.GetBuffer(), static_cast<int>(Size));
-        m_levelPak.m_pakFile.UpdateFile(levelDataFile.toUtf8().data(), FileOut);
-    }
-}
-
 //////////////////////////////////////////////////////////////////////////
 void CGameExporter::ExportLevelData(const QString& path, bool /*bExportMission*/)
 {

+ 0 - 2
Code/Editor/GameExporter.h

@@ -83,8 +83,6 @@ private:
     void ExportLevelData(const QString& path, bool bExportMission = true);
     void ExportLevelInfo(const QString& path);
 
-    void ExportOcclusionMesh(const char* pszGamePath);
-
     void ExportLevelResourceList(const QString& path);
     void ExportLevelUsedResourceList(const QString& path);
     void ExportFileList(const QString& path, const QString& levelName);

+ 0 - 3
Code/Editor/IEditor.h

@@ -53,7 +53,6 @@ class CDialog;
 class C3DConnexionDriver;
 #endif
 class CSettingsManager;
-struct IExportManager;
 class CDisplaySettings;
 class CLevelIndependentFileMan;
 class CSelectionTreeManager;
@@ -634,8 +633,6 @@ struct IEditor
 
     virtual void ReduceMemory() = 0;
 
-    //! Export manager for exporting objects and a terrain from the game to DCC tools
-    virtual IExportManager* GetExportManager() = 0;
     virtual ESystemConfigPlatform GetEditorConfigPlatform() const = 0;
     virtual void ReloadTemplates() = 0;
     virtual void ShowStatusText(bool bEnable) = 0;

+ 0 - 15
Code/Editor/IEditorImpl.cpp

@@ -41,7 +41,6 @@
 #include "ViewManager.h"
 #include "DisplaySettings.h"
 #include "KeyboardCustomizationSettings.h"
-#include "Export/ExportManager.h"
 #include "LevelIndependentFileMan.h"
 #include "TrackView/TrackViewSequenceManager.h"
 #include "AnimationContext.h"
@@ -112,7 +111,6 @@ CEditorImpl::CEditorImpl()
     , m_pConsoleSync(nullptr)
     , m_pSettingsManager(nullptr)
     , m_pLevelIndependentFileMan(nullptr)
-    , m_pExportManager(nullptr)
     , m_bMatEditMode(false)
     , m_bShowStatusText(true)
     , m_bInitialized(false)
@@ -267,9 +265,6 @@ CEditorImpl::~CEditorImpl()
     SAFE_DELETE(m_pViewManager)
     SAFE_DELETE(m_pObjectManager) // relies on prefab manager
 
-    // some plugins may be exporter - this must be above plugin manager delete.
-    SAFE_DELETE(m_pExportManager);
-
     SAFE_DELETE(m_pPluginManager)
     SAFE_DELETE(m_pAnimationContext) // relies on undo manager
     SAFE_DELETE(m_pUndoManager)
@@ -1370,16 +1365,6 @@ void CEditorImpl::ReduceMemory()
 #endif
 }
 
-IExportManager* CEditorImpl::GetExportManager()
-{
-    if (!m_pExportManager)
-    {
-        m_pExportManager = new CExportManager();
-    }
-
-    return m_pExportManager;
-}
-
 ESystemConfigPlatform CEditorImpl::GetEditorConfigPlatform() const
 {
     return m_pSystem->GetConfigPlatform();

+ 0 - 5
Code/Editor/IEditorImpl.h

@@ -36,7 +36,6 @@ class QMenu;
 class CObjectManager;
 class CUndoManager;
 class CGameEngine;
-class CExportManager;
 class CErrorsDlg;
 class CTrackViewSequenceManager;
 class CEditorFileMonitor;
@@ -262,8 +261,6 @@ public:
     //! Setup Material Editor mode
     void SetMatEditMode(bool bIsMatEditMode);
     void ReduceMemory() override;
-    // Get Export manager
-    IExportManager* GetExportManager() override;
     ESystemConfigPlatform GetEditorConfigPlatform() const override;
     void ReloadTemplates() override;
     void AddErrorMessage(const QString& text, const QString& caption);
@@ -339,8 +336,6 @@ protected:
 
     CLevelIndependentFileMan* m_pLevelIndependentFileMan;
 
-    //! Export manager for exporting objects and a terrain from the game to DCC tools
-    CExportManager* m_pExportManager;
     std::unique_ptr<CEditorFileMonitor> m_pEditorFileMonitor;
     QString m_selectFileBuffer;
     QString m_levelNameBuffer;

+ 0 - 182
Code/Editor/Include/IExportManager.h

@@ -1,182 +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 : Export geometry interfaces
-#pragma once
-
-#define EXP_NAMESIZE 32
-enum class AnimParamType;
-
-namespace Export
-{
-    struct Vector3D
-    {
-        float x, y, z;
-    };
-
-
-    struct Quat
-    {
-        Vector3D v;
-        float w;
-    };
-
-
-    struct UV
-    {
-        float u, v;
-    };
-
-
-    struct Face
-    {
-        uint32 idx[3];
-    };
-
-
-    struct Color
-    {
-        float r, g, b, a;
-    };
-
-    typedef char TPath[_MAX_PATH];
-
-    struct Material
-    {
-        Color diffuse;
-        Color specular;
-        float opacity;
-        float smoothness;
-        char name[EXP_NAMESIZE];
-        TPath mapDiffuse;
-        TPath mapSpecular;
-        TPath mapOpacity;
-        TPath mapNormals;
-        TPath mapDecal;
-        TPath mapDisplacement;
-    };
-
-
-    struct Mesh
-    {
-        Material material;
-
-        virtual int GetFaceCount() const = 0;
-        virtual const Face* GetFaceBuffer() const = 0;
-    };
-
-    // The numbers in this enum list must reflect the one from AnimParamType.h
-    enum AnimParamType
-    {
-        FOV         = 0,
-        PositionX   = 51,
-        PositionY   = 52,
-        PositionZ   = 53,
-        RotationX   = 54,
-        RotationY   = 55,
-        RotationZ   = 56,
-
-        // FocalLength is an exceptional case for FBX importing from Maya. In engine we use FoV, not Focal Length, therefore
-        // there is no equivalent AnimParamType::FocalLength in IMovieSystem.h. However we enumerate it here so we can detect
-        // and convert it to FoV during import
-        FocalLength,
-    };
-
-    enum EEntityObjectType
-    {
-        eEntity = 0,
-        eCamera = 1,
-        eCameraTarget = 2,
-    };
-
-    struct EntityAnimData
-    {
-        AnimParamType dataType;
-        float keyTime;
-        float keyValue;
-        float leftTangent;
-        float rightTangent;
-        float leftTangentWeight;
-        float rightTangentWeight;
-    };
-
-    struct Object
-    {
-        Vector3D pos;
-        Quat rot;
-        Vector3D scale;
-        char name[EXP_NAMESIZE];
-        char materialName[EXP_NAMESIZE];
-        int nParent;
-        EEntityObjectType entityType;
-        char cameraTargetNodeName[EXP_NAMESIZE];
-
-        virtual int GetVertexCount() const = 0;
-        virtual const Vector3D* GetVertexBuffer() const = 0;
-
-        virtual int GetNormalCount() const = 0;
-        virtual const Vector3D* GetNormalBuffer() const = 0;
-
-        virtual int GetTexCoordCount() const = 0;
-        virtual const UV* GetTexCoordBuffer() const = 0;
-
-        virtual int GetMeshCount() const = 0;
-        virtual Mesh* GetMesh(int index) const = 0;
-
-        virtual size_t  MeshHash() const =   0;
-
-        virtual int GetEntityAnimationDataCount() const = 0;
-        virtual const EntityAnimData* GetEntityAnimationData(int index) const = 0;
-        virtual void SetEntityAnimationData(EntityAnimData entityData) = 0;
-    };
-
-
-    // IData: Collection of data like object meshes, materials, animations, etc.
-    // used for export
-    // This data is collected by Export Manager implementation
-    struct IData
-    {
-        virtual int GetObjectCount() const = 0;
-        virtual Object* GetObject(int index) const = 0;
-        virtual Object* AddObject(const char* objectName) = 0;
-    };
-} // namespace Export
-
-
-
-// IExporter: interface to present an exporter
-// Exporter is responding to export data from object of IData type
-// to file with specified format
-// Exporter could be provided by user through plug-in system
-struct IExporter
-{
-    virtual ~IExporter() = default;
-    
-    // Get file extension of exporter type, f.i. "obj"
-    virtual const char* GetExtension() const = 0;
-
-    // Get short format description for showing it in FileSave dialog
-    // Example: "Object format"
-    virtual const char* GetShortDescription() const = 0;
-
-    // Implementation of en exporting data to the file
-    virtual bool ExportToFile(const char* filename, const Export::IData* pData) = 0;
-    virtual bool ImportFromFile(const char* filename, Export::IData* pData) = 0;
-
-    // Before Export Manager is destroyed Release will be called
-    virtual void Release() = 0;
-};
-
-// IExportManager: interface to export manager
-struct IExportManager
-{
-    //! Register exporter
-    //! return true if succeed, otherwise false
-    virtual bool RegisterExporter(IExporter* pExporter) = 0;
-};

+ 0 - 1
Code/Editor/Lib/Tests/IEditorMock.h

@@ -159,7 +159,6 @@ public:
     MOCK_METHOD0(IsSourceControlAvailable, bool());
     MOCK_METHOD0(IsSourceControlConnected, bool());
     MOCK_METHOD0(ReduceMemory, void());
-    MOCK_METHOD0(GetExportManager, IExportManager* ());
     MOCK_CONST_METHOD0(GetEditorConfigPlatform, ESystemConfigPlatform());
     MOCK_METHOD0(ReloadTemplates, void());
     MOCK_METHOD1(ShowStatusText, void(bool ));

+ 0 - 3
Code/Editor/MainWindow.cpp

@@ -686,9 +686,6 @@ void MainWindow::InitActions()
             .RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateDocumentReady);
     }
 
-    am->AddAction(ID_FILE_EXPORT_SELECTEDOBJECTS, tr("Export Selected &Objects"))
-        .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"));

+ 0 - 2
Code/Editor/Resource.h

@@ -182,7 +182,6 @@
 #define ID_MODIFY_AIPOINT_PICKIMPASSLINK           33865
 #define ID_FILE_EXPORTSELECTION                    33875
 #define ID_EDIT_PASTE_WITH_LINKS                   33893
-#define ID_FILE_EXPORT_SELECTEDOBJECTS             33911
 #define ID_SPLINE_PREVIOUS_KEY                     33916
 #define ID_SPLINE_NEXT_KEY                         33917
 #define ID_SPLINE_FLATTEN_ALL                      33918
@@ -247,7 +246,6 @@
 #define ID_SET_TIME_TO_KEY                         34206
 #define ID_TOGGLE_SCRUB_UNITS                      34207
 #define ID_TOGGLE_PREVIEW_UNITS                    34208
-#define ID_FILE_EXPORTOCCLUSIONMESH                34209
 #define ID_MANN_RELOAD_ANIMS                       34210
 #define ID_FILE_ANIMDBEDITOR                       34211
 #define ID_SNAP_TO_ANGLE_RANGE_BEGIN    34323

+ 0 - 49
Code/Editor/TrackView/TrackViewDialog.cpp

@@ -1018,21 +1018,6 @@ void CTrackViewDialog::OnSyncSelectedTracksFromBase()
     }
 }
 
-void CTrackViewDialog::OnExportFBXSequence()
-{
-    SaveCurrentSequenceToFBX();
-}
-
-void CTrackViewDialog::OnExportNodeKeysGlobalTime()
-{
-    CExportManager* pExportManager = static_cast<CExportManager*>(GetIEditor()->GetExportManager());
-
-    if (pExportManager)
-    {
-        pExportManager->SaveNodeKeysTimeToXML();
-    }
-}
-
 //////////////////////////////////////////////////////////////////////////
 void CTrackViewDialog::OnAddSequence()
 {
@@ -2321,40 +2306,6 @@ void CTrackViewDialog::EndUndoTransaction()
     m_bDoingUndoOperation = false;
 }
 
-void CTrackViewDialog::SaveCurrentSequenceToFBX()
-{
-    CTrackViewSequence* sequence = GetIEditor()->GetAnimation()->GetSequence();
-    if (!sequence)
-    {
-        return;
-    }
-
-    QString selectedSequenceFBXStr = QString::fromUtf8(sequence->GetName().c_str()) + ".fbx";
-    CExportManager* pExportManager = static_cast<CExportManager*>(GetIEditor()->GetExportManager());
-    const char szFilters[] = "FBX Files (*.fbx)";
-
-    CFBXExporterDialog fpsDialog;
-
-    CTrackViewTrackBundle allTracks = sequence->GetAllTracks();
-
-    for (unsigned int trackID = 0; trackID < allTracks.GetCount(); ++trackID)
-    {
-        CTrackViewTrack* pCurrentTrack = allTracks.GetTrack(trackID);
-
-        if (!pCurrentTrack->GetParentNode()->IsSelected())
-        {
-            continue;
-        }
-    }
-
-    QString filename = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Export Selected Nodes To FBX File"), selectedSequenceFBXStr, szFilters);
-    if (!filename.isEmpty())
-    {
-        pExportManager->SetBakedKeysSequenceExport(true);
-        pExportManager->Export(filename.toUtf8().data(), "", "", false, false, false, true);
-    }
-}
-
 void CTrackViewDialog::AfterEntitySelectionChanged(
     [[maybe_unused]] const AzToolsFramework::EntityIdList& newlySelectedEntities,
     [[maybe_unused]] const AzToolsFramework::EntityIdList& newlyDeselectedEntities)

+ 0 - 3
Code/Editor/TrackView/TrackViewDialog.h

@@ -101,8 +101,6 @@ protected slots:
     void OnSyncSelectedTracksToBase();
     void OnSyncSelectedTracksFromBase();
     void OnAddSequence();
-    void OnExportFBXSequence();
-    void OnExportNodeKeysGlobalTime();
     void OnDelSequence();
     void OnEditSequence();
     void OnSequenceComboBox();
@@ -211,7 +209,6 @@ private:
 
     void BeginUndoTransaction() override;
     void EndUndoTransaction() override;
-    void SaveCurrentSequenceToFBX();
     void SaveSequenceTimingToXML();
 
     // ToolsApplicationNotificationBus ...

+ 1 - 261
Code/Editor/TrackView/TrackViewNodes.cpp

@@ -1004,54 +1004,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
 
     float scrollPos = SaveVerticalScrollPos();
 
-    if (cmd == eMI_SaveToFBX)
-    {
-        CExportManager* pExportManager = static_cast<CExportManager*>(GetIEditor()->GetExportManager());
-
-        if (pExportManager)
-        {
-            CTrackViewSequence* sequence2 = GetIEditor()->GetAnimation()->GetSequence();
-            if (!sequence2)
-            {
-                return;
-            }
-
-            CTrackViewAnimNodeBundle selectedNodes = sequence2->GetSelectedAnimNodes();
-            const unsigned int numSelectedNodes = selectedNodes.GetCount();
-            if (numSelectedNodes == 0)
-            {
-                return;
-            }
-
-            QString file = QString::fromUtf8(sequence2->GetName().c_str()) + QString(".fbx");
-            QString selectedSequenceFBXStr = QString::fromUtf8(sequence2->GetName().c_str()) + ".fbx";
-
-            if (numSelectedNodes > 1)
-            {
-                file = selectedSequenceFBXStr;
-            }
-            else
-            {
-                file = QString::fromUtf8(selectedNodes.GetNode(0)->GetName().c_str()) + QString(".fbx");
-            }
-
-            QString path = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Export Selected Nodes To FBX File"), QString(), tr("FBX Files (*.fbx)"));
-
-            if (!path.isEmpty())
-            {
-                pExportManager->SetBakedKeysSequenceExport(false);
-                pExportManager->Export(path.toUtf8().data(), "", "", false, false, false, true);
-            }
-        }
-    }
-    else if (cmd == eMI_ImportFromFBX)
-    {
-        if (animNode)
-        {
-            ImportFromFBX();
-        }
-    }
-    else if (cmd == eMI_SetAsViewCamera)
+    if (cmd == eMI_SetAsViewCamera)
     {
         if (animNode && animNode->GetType() == AnimNodeType::Camera)
         {
@@ -1540,219 +1493,6 @@ void CTrackViewNodesCtrl::OnItemDblClick(QTreeWidgetItem* item, int)
     }
 }
 
-CTrackViewTrack* CTrackViewNodesCtrl::GetTrackViewTrack(const Export::EntityAnimData* pAnimData, CTrackViewTrackBundle trackBundle, const QString& nodeName)
-{
-    for (unsigned int trackID = 0; trackID < trackBundle.GetCount(); ++trackID)
-    {
-        CTrackViewTrack* pTrack = trackBundle.GetTrack(trackID);
-        const QString bundleTrackName = QString::fromUtf8(pTrack->GetAnimNode()->GetName().c_str());
-
-        if (bundleTrackName.compare(nodeName, Qt::CaseInsensitive) != 0)
-        {
-            continue;
-        }
-
-        // Position, Rotation
-        if (pTrack->IsCompoundTrack())
-        {
-            for (unsigned int childTrackID = 0; childTrackID < pTrack->GetChildCount(); ++childTrackID)
-            {
-                CTrackViewTrack* childTrack = static_cast<CTrackViewTrack*>(pTrack->GetChild(childTrackID));
-                // Have to cast GetType to int since the enum it returns is not the same enum that pAnimData->dataType is
-                if (static_cast<int>(childTrack->GetParameterType().GetType()) == pAnimData->dataType)
-                {
-                    return childTrack;
-                }
-            }
-        }
-
-        // FOV
-        // Have to cast GetType to int since the enum it returns is not the same enum that pAnimData->dataType is
-        if (static_cast<int>(pTrack->GetParameterType().GetType()) == pAnimData->dataType)
-        {
-            return pTrack;
-        }
-    }
-
-    return nullptr;
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CTrackViewNodesCtrl::ImportFromFBX()
-{
-    CExportManager* pExportManager = static_cast<CExportManager*>(GetIEditor()->GetExportManager());
-
-    CAutoDirectoryRestoreFileDialog dlg(QFileDialog::AcceptOpen, QFileDialog::AnyFile, {}, {}, "FBX Files (*.fbx)", {}, {}, this);
-
-    if (dlg.exec())
-    {
-        bool bImportResult = pExportManager->ImportFromFile(dlg.selectedFiles().first().toStdString().c_str());
-
-        if (!bImportResult)
-        {
-            return;
-        }
-    }
-    else
-    {
-        return;
-    }
-
-    CTrackViewSequence* sequence = GetIEditor()->GetAnimation()->GetSequence();
-
-    if (sequence)
-    {
-        AzToolsFramework::ScopedUndoBatch undoBatch("Replace Keys");
-        CTrackViewTrackBundle tracks = sequence->GetAllTracks();
-        const unsigned int numTracks = tracks.GetCount();
-
-        for (unsigned int trackID = 0; trackID < numTracks; ++trackID)
-        {
-            undoBatch.MarkEntityDirty(sequence->GetSequenceComponentEntityId());
-        }
-
-        CTrackViewTrackBundle trackBundle = sequence->GetAllTracks();
-
-        const Export::CData pData = pExportManager->GetData();
-        const int objectsCount = pData.GetObjectCount();
-
-        CTrackViewFBXImportPreviewDialog importSelectionDialog;
-
-        for (int objectID = 0; objectID < objectsCount; ++objectID)
-        {
-            importSelectionDialog.AddTreeItem(pData.GetObject(objectID)->name);
-        }
-
-        if (importSelectionDialog.exec() != QDialog::Accepted)
-        {
-            return;
-        }
-
-        // Remove all keys from the affected tracks
-        for (int objectID = 0; objectID < objectsCount; ++objectID)
-        {
-            Export::Object* pObject = pData.GetObject(objectID);
-
-            if (pObject)
-            {
-                // Clear only the selected tracks for which we have AnimNodes
-                if (!importSelectionDialog.IsObjectSelected(pObject->name))
-                {
-                    continue;
-                }
-                const char* updatedNodeName = pObject->name;
-                if (sequence->GetAnimNodesByName(updatedNodeName).GetCount() == 0)
-                {
-                    continue;
-                }
-
-                int animatonDataCount = pObject->GetEntityAnimationDataCount();
-                for (int animDataID = 0; animDataID < animatonDataCount; ++animDataID)
-                {
-                    const Export::EntityAnimData* pAnimData = pObject->GetEntityAnimationData(animDataID);
-
-                    CTrackViewTrack* pTrack = GetTrackViewTrack(pAnimData, trackBundle, (QString)updatedNodeName);
-
-                    if (pTrack)
-                    {
-                        CTrackViewKeyBundle keys = pTrack->GetAllKeys();
-
-                        for (int deleteKeyID = (int)keys.GetKeyCount() - 1; deleteKeyID >= 0; --deleteKeyID)
-                        {
-                            CTrackViewKeyHandle key = keys.GetKey(deleteKeyID);
-                            key.Delete();
-                        }
-                    }
-                }
-            }
-        }
-        // Add keys from FBX file
-        for (int objectID = 0; objectID < objectsCount; ++objectID)
-        {
-            const Export::Object* pObject = pData.GetObject(objectID);
-
-            if (pObject)
-            {
-                // only process selected nodes from file for which we have AnimNodes
-                if (!importSelectionDialog.IsObjectSelected(pObject->name))
-                {
-                    continue;
-                }
-                const char* updatedNodeName = pObject->name;
-                if (sequence->GetAnimNodesByName(updatedNodeName).GetCount() == 0)
-                {
-                    continue;
-                }
-
-                const int animatonDataCount = pObject->GetEntityAnimationDataCount();
-
-                // Add keys from the imported file to the selected tracks
-                for (int animDataID = 0; animDataID < animatonDataCount; ++animDataID)
-                {
-                    const Export::EntityAnimData* pAnimData = pObject->GetEntityAnimationData(animDataID);
-                    CTrackViewTrack* pTrack = GetTrackViewTrack(pAnimData, trackBundle, (QString)updatedNodeName);
-
-                    if (pTrack)
-                    {
-                        CTrackViewKeyHandle key = pTrack->CreateKey(pAnimData->keyTime);
-                        I2DBezierKey bezierKey;
-                        key.GetKey(&bezierKey);
-                        bezierKey.value = Vec2(pAnimData->keyTime, pAnimData->keyValue);
-                        key.SetKey(&bezierKey);
-                    }
-                }
-
-                // After all keys are added, we are able to add the left and right tangents to the imported keys
-                for (int animDataID = 0; animDataID < animatonDataCount; ++animDataID)
-                {
-                    const Export::EntityAnimData* pAnimData = pObject->GetEntityAnimationData(animDataID);
-
-                    CTrackViewTrack* pTrack = GetTrackViewTrack(pAnimData, trackBundle, (QString)updatedNodeName);
-
-                    if (pTrack)
-                    {
-                        CTrackViewKeyHandle key = pTrack->GetKeyByTime(pAnimData->keyTime);
-                        ISplineInterpolator* pSpline = pTrack->GetSpline();
-
-                        if (pSpline)
-                        {
-                            const int keyIndex = key.GetIndex();
-
-                            ISplineInterpolator::ValueType inTangent;
-                            ISplineInterpolator::ValueType outTangent;
-                            ZeroStruct(inTangent);
-                            ZeroStruct(outTangent);
-
-                            float currentKeyTime = 0.0f;
-                            pSpline->SetKeyFlags(keyIndex, SPLINE_KEY_TANGENT_BROKEN);
-
-                            if (keyIndex > 0)
-                            {
-                                currentKeyTime = key.GetTime() - key.GetPrevKey().GetTime();
-                                inTangent[0] = pAnimData->leftTangentWeight * currentKeyTime;
-                                inTangent[1] = inTangent[0] * pAnimData->leftTangent;
-                                pSpline->SetKeyInTangent(keyIndex, inTangent);
-                            }
-
-                            if (keyIndex < static_cast<int>(pTrack->GetKeyCount() - 1))
-                            {
-                                CTrackViewKeyHandle nextKey = key.GetNextKey();
-                                if (nextKey.IsValid())
-                                {
-                                    currentKeyTime = nextKey.GetTime() - key.GetTime();
-                                    outTangent[0] = pAnimData->rightTangentWeight * currentKeyTime;
-                                    outTangent[1] = outTangent[0] * pAnimData->rightTangent;
-                                    pSpline->SetKeyOutTangent(keyIndex, outTangent);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
 //////////////////////////////////////////////////////////////////////////
 void CTrackViewNodesCtrl::EditEvents()
 {

+ 0 - 4
Code/Editor/TrackView/TrackViewNodes.h

@@ -20,7 +20,6 @@
 #include "TrackViewNode.h"
 #include "TrackViewSequence.h"
 #include "Undo/Undo.h"
-#include "Export/ExportManager.h"
 
 #include <IMovieSystem.h>
 #include <QMap>
@@ -131,9 +130,6 @@ private:
     void CreateFolder(CTrackViewAnimNode* pGroupNode);
     void EditEvents();
 
-    void ImportFromFBX();
-    CTrackViewTrack* GetTrackViewTrack(const Export::EntityAnimData* pAnimData, CTrackViewTrackBundle trackBundle, const QString& nodeName);
-
     void AddMenuSeperatorConditional(QMenu& menu, bool& bAppended);
     void AddGroupNodeAddItems(struct SContextMenu& contextMenu, CTrackViewAnimNode* pAnimNode);
     int ShowPopupMenuSingleSelection(struct SContextMenu& contextMenu, CTrackViewSequence* pSequence, CTrackViewNode* pNode);

+ 0 - 7
Code/Editor/editor_lib_files.cmake

@@ -276,7 +276,6 @@ set(FILES
     Include/ICommandManager.h
     Include/IDisplayViewport.h
     Include/IEditorClassFactory.h
-    Include/IExportManager.h
     Include/ILogFile.h
     Include/IKeyTimeSet.h
     Include/IObjectManager.h
@@ -414,12 +413,6 @@ set(FILES
     Dialogs/PythonScriptsDialog.ui
     Dialogs/Generic/UserOptions.cpp
     Dialogs/Generic/UserOptions.h
-    Export/ExportManager.cpp
-    Export/ExportManager.h
-    Export/OBJExporter.cpp
-    Export/OBJExporter.h
-    Export/OCMExporter.cpp
-    Export/OCMExporter.h
     EditorFileMonitor.cpp
     EditorFileMonitor.h
     Include/IEditorFileMonitor.h

+ 0 - 4
Gems/LmbrCentral/Code/Source/Builders/LevelBuilder/LevelBuilderWorker.cpp

@@ -194,10 +194,6 @@ namespace LevelBuilder
         //  The defines exist in CryEngine code that we can't link from here.
         //  We want to minimize engine changes to make it easier for game teams to incorporate these dependency improvements.
 
-        // CCullThread::LoadLevel attempts to load the occluder mesh, if it exists.
-        //      AZ::IO::HandleType fileHandle = gEnv->pCryPak->FOpen((string(pFolderName) + "/occluder.ocm").c_str(), "rbx");
-        AddLevelRelativeSourcePathProductDependency("occluder.ocm", sourceLevelPakPath, productPathDependencies);
-
         // C3DEngine::LoadLevel attempts to load this file for the current level, if it exists.
         //      GetISystem()->LoadConfiguration(GetLevelFilePath(LEVEL_CONFIG_FILE));
         AddLevelRelativeSourcePathProductDependency("level.cfg", sourceLevelPakPath, productPathDependencies);

+ 0 - 1
Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp

@@ -22,7 +22,6 @@
 
 #include "Objects/EntityObject.h"
 #include "ViewManager.h"
-#include "Export/ExportManager.h"
 #include <Editor/Util/fastlib.h>
 
 #include "QtUtilWin.h"