2015-09-20 14:44:56 +00:00
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2015 Winch Gate Property Limited
// Author: Jan Boon <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2015-09-20 15:22:24 +00:00
# ifndef NL_SCENE_META_H
# define NL_SCENE_META_H
2015-09-20 14:44:56 +00:00
# include <nel/misc/types_nl.h>
# include <nel/misc/sstring.h>
2015-09-20 19:08:30 +00:00
# include <nel/misc/smart_ptr.h>
# include <nel/3d/material.h>
2015-09-20 14:44:56 +00:00
namespace NLMISC {
class IStream ;
}
2015-09-20 19:08:30 +00:00
namespace NL3D {
class CMaterial ;
}
2015-09-20 14:44:56 +00:00
enum TMesh
{
TMeshDisabled = 0 ,
TMeshShape = 1 ,
TMeshCollisionInt = 2 ,
TMeshCollisionExt = 3 ,
TMeshZone = 4 ,
2015-09-20 17:03:05 +00:00
TMeshPortal = 5 ,
TMeshCluster = 6 ,
2015-09-20 14:44:56 +00:00
} ;
enum TBone
{
TBoneAuto = 0 ,
TBoneForce = 1 , // Force this node to be part of a skeleton
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)
} ;
struct CNodeMeta
{
CNodeMeta ( ) ;
bool AddToIG ; // Add this node to an instance group
TMesh ExportMesh ;
2015-09-20 17:03:05 +00:00
TBone ExportBone ;
2015-09-20 14:44:56 +00:00
std : : string InstanceShape ;
std : : string InstanceName ;
std : : string InstanceGroupName ;
2015-09-20 17:03:05 +00:00
bool AutoAnim ;
2015-09-20 19:08:30 +00:00
// 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.
2015-09-20 17:03:05 +00:00
2015-09-20 14:44:56 +00:00
void serial ( NLMISC : : IStream & s ) ;
} ;
enum TSkel
{
TSkelLocal = 0 , // Export smallest skeleton possible from connected bones
2015-09-20 15:03:44 +00:00
TSkelRoot = 1 , // Export skeleton from a direct child node in the scene root node
2015-09-20 14:44:56 +00:00
TSkelFull = 2 , // Include all connected child nodes in the skeleton
} ;
2015-09-20 19:08:30 +00:00
typedef std : : map < NLMISC : : CSString , NLMISC : : CSmartPtr < NL3D : : CMaterial > > TMaterialMap ;
2015-09-20 14:44:56 +00:00
struct CSceneMeta
{
CSceneMeta ( ) ;
2015-09-21 16:11:35 +00:00
bool ImportShape ;
bool ImportSkel ;
bool ImportAnim ;
bool ImportCmb ;
bool ImportIG ;
2015-09-20 19:08:30 +00:00
bool ExportDefaultIG ; // Export a default instance group from nodes the scene that do not have an instance group set
2015-09-20 14:44:56 +00:00
TSkel SkeletonMode ;
2015-09-20 19:08:30 +00:00
2015-09-20 14:44:56 +00:00
std : : map < NLMISC : : CSString , CNodeMeta > Nodes ;
2015-09-20 19:08:30 +00:00
TMaterialMap Materials ;
2015-09-20 14:44:56 +00:00
const std : : string & metaFilePath ( ) const { return m_MetaFilePath ; }
bool load ( const std : : string & filePath ) ;
void save ( ) ;
void serial ( NLMISC : : IStream & s ) ;
private :
std : : string m_MetaFilePath ;
} ;
2015-09-20 15:22:24 +00:00
# endif NL_SCENE_META_H
2015-09-20 14:44:56 +00:00
/* end of file */