diff --git a/code/nel/tools/pipeline/max/builtin/animatable.cpp b/code/nel/tools/pipeline/max/builtin/animatable.cpp index 13d2ac7aa..6252879f6 100644 --- a/code/nel/tools/pipeline/max/builtin/animatable.cpp +++ b/code/nel/tools/pipeline/max/builtin/animatable.cpp @@ -85,8 +85,13 @@ void CAnimatable::init() CSceneClass::init(); } -// inherited -const ISceneClassDesc *CAnimatable::classDesc() +bool CAnimatable::inherits(const NLMISC::CClassId classId) const +{ + if (classId == classDesc()->classId()) return true; + return CSceneClass::inherits(classId); +} + +const ISceneClassDesc *CAnimatable::classDesc() const { return &AnimatableClassDesc; } diff --git a/code/nel/tools/pipeline/max/builtin/animatable.h b/code/nel/tools/pipeline/max/builtin/animatable.h index f127ee2b8..fd586db32 100644 --- a/code/nel/tools/pipeline/max/builtin/animatable.h +++ b/code/nel/tools/pipeline/max/builtin/animatable.h @@ -66,7 +66,8 @@ public: virtual void build(uint16 version); virtual void disown(); virtual void init(); - virtual const ISceneClassDesc *classDesc(); + virtual bool inherits(const NLMISC::CClassId classId) const; + virtual const ISceneClassDesc *classDesc() const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; }; /* class CAnimatable */ diff --git a/code/nel/tools/pipeline/max/scene_class.cpp b/code/nel/tools/pipeline/max/scene_class.cpp index 891c65bed..bf47140dd 100644 --- a/code/nel/tools/pipeline/max/scene_class.cpp +++ b/code/nel/tools/pipeline/max/scene_class.cpp @@ -181,7 +181,7 @@ IStorageObject *CSceneClass::createChunkById(uint16 id, bool container) return CStorageContainer::createChunkById(id, container); } -const ucchar *CSceneClass::DisplayName = ucstring("Scene Class").c_str(); +const ucchar *CSceneClass::DisplayName = ucstring("Invalid Scene Class").c_str(); const char *CSceneClass::InternalName = "SceneClass"; const NLMISC::CClassId CSceneClass::ClassId = NLMISC::CClassId::Null; // This class is invalid const TSClassId CSceneClass::SuperClassId = 0x0000; // This class is invalid @@ -190,7 +190,12 @@ namespace { static const CSceneClassDesc SceneClassDesc(static_cast(&DllPluginDescBuiltin)); } /* anonymous namespace */ -const ISceneClassDesc *CSceneClass::classDesc() +bool CSceneClass::inherits(const NLMISC::CClassId classId) const +{ + return false; +} + +const ISceneClassDesc *CSceneClass::classDesc() const { return static_cast(&SceneClassDesc); } diff --git a/code/nel/tools/pipeline/max/scene_class.h b/code/nel/tools/pipeline/max/scene_class.h index f90639d82..c9029798c 100644 --- a/code/nel/tools/pipeline/max/scene_class.h +++ b/code/nel/tools/pipeline/max/scene_class.h @@ -91,8 +91,10 @@ public: //! \name More virtual functionality for inheriting classes to implement //@{ + /// Returns whether the class inherits from a class with given class id + virtual bool inherits(const NLMISC::CClassId classId) const; /// Return the class description of the inheriting class - virtual const ISceneClassDesc *classDesc(); + virtual const ISceneClassDesc *classDesc() const; /// Create a readable representation of this class virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; //@} diff --git a/code/nel/tools/pipeline/max/scene_class_unknown.h b/code/nel/tools/pipeline/max/scene_class_unknown.h index c27375ed0..b6c47a3d4 100644 --- a/code/nel/tools/pipeline/max/scene_class_unknown.h +++ b/code/nel/tools/pipeline/max/scene_class_unknown.h @@ -100,7 +100,7 @@ public: virtual ~CSceneClassUnknown() { } // inherited - virtual const ISceneClassDesc *classDesc() { return &m_Desc; } + virtual const ISceneClassDesc *classDesc() const { return &m_Desc; } private: CSceneClassUnknownDesc m_Desc;