Fix game:addSpawnShapesByZone
[ryzomcore.git] / nel / tools / 3d / mesh_utils / scene_meta.h
blob75506999bc07563b2869d9ef32b585ca15f6317f
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2015 Winch Gate Property Limited
3 //
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.
8 //
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 #ifndef NL_SCENE_META_H
20 #define NL_SCENE_META_H
21 #include <nel/misc/types_nl.h>
23 #include <nel/misc/sstring.h>
24 #include <nel/misc/smart_ptr.h>
26 #include <nel/3d/material.h>
28 namespace NLMISC {
29 class IStream;
32 namespace NL3D {
33 class CMaterial;
36 enum TMesh
38 TMeshDisabled = 0,
39 TMeshShape = 1,
40 TMeshCollisionInt = 2,
41 TMeshCollisionExt = 3,
42 TMeshZone = 4,
43 TMeshPortal = 5,
44 TMeshCluster = 6,
47 enum TBone
49 TBoneAuto = 0,
50 TBoneForce = 1, // Force this node to be part of a skeleton
51 TBoneRoot = 2, // Make this node the skeleton root, it will be exported using the scene name. There can only be one (editor should keep track and disable)
54 struct CNodeMeta
56 CNodeMeta();
58 bool AddToIG; // Add this node to an instance group
59 TMesh ExportMesh;
60 TBone ExportBone;
62 std::string InstanceShape;
63 std::string InstanceName;
64 std::string InstanceGroupName;
66 bool AutoAnim;
67 // std::vector<NLMISC::CSString> Materials; // In case there's an issue with nameless materials in some format... Map to material entirely in the meta editor.
69 void serial(NLMISC::IStream &s);
72 enum TSkel
74 TSkelLocal = 0, // Export smallest skeleton possible from connected bones
75 TSkelRoot = 1, // Export skeleton from a direct child node in the scene root node
76 TSkelFull = 2, // Include all connected child nodes in the skeleton
79 typedef std::map<NLMISC::CSString, NLMISC::CSmartPtr<NL3D::CMaterial> > TMaterialMap;
80 struct CSceneMeta
82 CSceneMeta();
84 bool ImportShape;
85 bool ImportSkel;
86 bool ImportAnim;
87 bool ImportCmb;
88 bool ImportIG;
90 bool ExportDefaultIG; // Export a default instance group from nodes the scene that do not have an instance group set
91 TSkel SkeletonMode;
93 std::map<NLMISC::CSString, CNodeMeta> Nodes;
94 TMaterialMap Materials;
96 const std::string &metaFilePath() const { return m_MetaFilePath; }
98 bool load(const std::string &filePath);
99 void save();
100 void serial(NLMISC::IStream &s);
102 private:
103 std::string m_MetaFilePath;
107 #endif /* NL_SCENE_META_H */
109 /* end of file */