WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
FBXExporter.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------*\
2| This file is part of WoW Model Viewer |
3| |
4| WoW Model Viewer is free software: you can redistribute it and/or |
5| modify it under the terms of the GNU General Public License as |
6| published by the Free Software Foundation, either version 3 of the |
7| License, or (at your option) any later version. |
8| |
9| WoW Model Viewer is distributed in the hope that it will be useful, |
10| but WITHOUT ANY WARRANTY; without even the implied warranty of |
11| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12| GNU General Public License for more details. |
13| |
14| You should have received a copy of the GNU General Public License |
15| along with WoW Model Viewer. |
16| If not, see <http://www.gnu.org/licenses/>. |
17\*----------------------------------------------------------------------*/
18
19/*
20 * FBXExporter.h
21 *
22 * Created on: 13 june 2015
23 * Copyright: 2015 , WoW Model Viewer (http://wowmodelviewer.net)
24 */
25
26#pragma once
27
28#include <map>
29#include <mutex>
30#include <string>
31#include <vector>
32
33#include "fbxsdk.h"
34
35class WoWModel;
36struct ModelAnimation;
37
38#include "ExporterPlugin.h"
39
41class FBXExporter : public ExporterPlugin //-V1106
42{
43
44public:
46
47 ~FBXExporter() = default;
48
49 std::wstring menuLabel() const;
50 std::wstring fileSaveTitle() const;
51 std::wstring fileSaveFilter() const;
52
53 bool exportModel(Model*, std::wstring file);
54
55private:
56 void createMaterials();
57 void createMeshes();
58 void createSkeletons();
60 void createAnimations();
62 void reset();
63
64 FbxManager* m_p_manager;
65 FbxScene* m_p_scene;
67 FbxNode* m_p_meshNode;
69 std::vector<WoWModel*> m_p_attachedModels;
70
71 mutable std::mutex m_mutex;
72 bool useAltAnimNaming = false;
73 FbxString m_fileVersion;
74 std::wstring m_filename;
75 std::map<int, FbxNode*> m_boneNodes;
76 std::vector<FbxCluster*> m_boneClusters;
77
78 std::map<int, FbxNode*> m_attachSkeletonNode;
79 std::map<int, FbxNode*> m_attachMeshNodes;
80 std::map<int, std::map<int, FbxNode*>> m_attachBoneNodes;
81 std::map<int, std::vector<FbxCluster*>> m_attachBoneClusters;
82
83 std::map<std::wstring, GLuint> m_texturesToExport;
84};
Abstract base class for model export plugins (OBJ, FBX, etc.).
Exports WoW models to Autodesk FBX format with meshes, skeletons, and animations.
Definition FBXExporter.h:42
FbxNode * m_p_skeletonNode
Definition FBXExporter.h:68
bool exportModel(Model *, std::wstring file)
FbxString m_fileVersion
Definition FBXExporter.h:73
std::wstring fileSaveFilter() const
void createAnimations()
void createMeshes()
WoWModel * m_p_model
Definition FBXExporter.h:66
std::map< int, FbxNode * > m_boneNodes
Definition FBXExporter.h:75
std::map< std::wstring, GLuint > m_texturesToExport
Definition FBXExporter.h:83
~FBXExporter()=default
FbxNode * m_p_meshNode
Definition FBXExporter.h:67
std::wstring fileSaveTitle() const
std::map< int, std::vector< FbxCluster * > > m_attachBoneClusters
Definition FBXExporter.h:81
void linkMeshAndSkeleton()
std::wstring m_filename
Definition FBXExporter.h:74
std::mutex m_mutex
Definition FBXExporter.h:71
std::wstring menuLabel() const
FbxScene * m_p_scene
Definition FBXExporter.h:65
void createSkeletons()
std::map< int, FbxNode * > m_attachSkeletonNode
Definition FBXExporter.h:78
bool useAltAnimNaming
Definition FBXExporter.h:72
FbxManager * m_p_manager
Definition FBXExporter.h:64
std::vector< WoWModel * > m_p_attachedModels
Definition FBXExporter.h:69
std::vector< FbxCluster * > m_boneClusters
Definition FBXExporter.h:76
std::map< int, std::map< int, FbxNode * > > m_attachBoneNodes
Definition FBXExporter.h:80
bool createAnimationFiles()
std::map< int, FbxNode * > m_attachMeshNodes
Definition FBXExporter.h:79
void createMaterials()
Abstract base interface for all 3D model types.
Definition Model.h:5
Core WoW .m2 model: geometry, animation, textures, and character data.
Definition WoWModel.h:50
An animation sequence entry in the M2 model (block B).