-
Notifications
You must be signed in to change notification settings - Fork 1
/
BlenderFile.h
51 lines (39 loc) · 1.07 KB
/
BlenderFile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include "BlenderCommon.h"
#include "BlenderFileBlock.h"
#include "BlenderMesh.h"
#include "BlenderArmature.h"
struct BlenderFileHeader {
char identifier[8];
unsigned short pointer_size;
bool little_endian;
char version[4];
};
class BlenderFile {
public:
BlenderFile() {}
BlenderFile(std::string filename, BlenderImporterConfig config);
~BlenderFile();
void Load();
std::string GetFilename();
std::string GetHeaderInfo();
int GetNumFileBlocks();
std::string GetFileBlockInfo(int index);
bool ExtractSDNA(BlenderFileBlock &block);
std::string GetSDNAInfo();
StructureDNA *GetSDNA() { return &m_SDNA; }
BlenderMesh *GetMesh() { return &m_Mesh; }
BlenderArmature *GetArmature() { return &m_Armature; }
void Release();
void ReleaseFileBlocks();
private:
std::string m_Filename;
BlenderImporterConfig m_Config;
BlenderFileHeader m_FileHeader;
std::vector<BlenderFileBlock> m_FileBlocks;
std::vector<BlenderFileBlock> m_MeshBlocks;
std::vector<BlenderFileBlock> m_ArmatureBlocks;
StructureDNA m_SDNA;
BlenderMesh m_Mesh;
BlenderArmature m_Armature;
};