1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2015 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero 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.
9 // This program 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 Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // Author: Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
19 #include <nel/misc/types_nl.h>
20 #include "scene_meta.h"
22 #include <nel/misc/debug.h>
23 #include <nel/misc/stream.h>
24 #include <nel/misc/file.h>
26 #include <nel/3d/material.h>
29 using namespace NLMISC
;
31 CNodeMeta::CNodeMeta() :
33 ExportMesh(TMeshShape
),
34 ExportBone(TBoneAuto
),
40 void CNodeMeta::serial(NLMISC::IStream
&s
)
42 uint version
= s
.serialVersion(1);
44 s
.serial((uint32
&)ExportMesh
);
45 s
.serial((uint32
&)ExportBone
);
46 s
.serial(InstanceShape
);
47 s
.serial(InstanceName
);
48 s
.serial(InstanceGroupName
);
52 CSceneMeta::CSceneMeta() :
58 ExportDefaultIG(false),
59 SkeletonMode(TSkelRoot
)
64 bool CSceneMeta::load(const std::string
&filePath
)
66 m_MetaFilePath
= NLMISC::CPath::standardizePath(filePath
+ ".nelmeta", false);
67 if (CFile::fileExists(m_MetaFilePath
))
69 CIFile
f(m_MetaFilePath
);
77 void CSceneMeta::save()
79 COFile
f(m_MetaFilePath
, false, false, true);
84 void CSceneMeta::serial(NLMISC::IStream
&s
)
86 uint version
= s
.serialVersion(1);
88 s
.serial(ImportShape
);
94 s
.serial(ExportDefaultIG
);
95 s
.serial((uint32
&)SkeletonMode
);
98 s
.serialPtrCont(Materials
);