diff --git a/code/nel/tools/pipeline/max/builtin/i_node.cpp b/code/nel/tools/pipeline/max/builtin/i_node.cpp index 87f8a4b13..867e0e38c 100644 --- a/code/nel/tools/pipeline/max/builtin/i_node.cpp +++ b/code/nel/tools/pipeline/max/builtin/i_node.cpp @@ -156,6 +156,43 @@ const ucstring &INode::userName() const return v; } +void INode::dumpNodes(std::ostream &ostream, const std::string &pad) const +{ + ostream << " " << userName().toUtf8() << " [" << m_Children.size() << "] { "; + CReferenceMaker *object = getReference(1); + if (object) // TODO: Implement! + { + ostream << "\n" << pad << "Object: "; + ostream << " "; + ostream << ucstring(object->classDesc()->displayName()).toUtf8() << " "; + } + uint i = 0 ; + std::string padpad = pad + "\t"; + for (std::set >::iterator it = m_Children.begin(), end = m_Children.end(); it != end; ++it) + { + INode *node = (*it); + nlassert(node); + ostream << "\n" << pad << i << ": "; + node->dumpNodes(ostream, padpad); + ++i; + } + ostream << "} "; +} + IStorageObject *INode::createChunkById(uint16 id, bool container) { return CReferenceTarget::createChunkById(id, container); diff --git a/code/nel/tools/pipeline/max/builtin/i_node.h b/code/nel/tools/pipeline/max/builtin/i_node.h index 1688f312a..edd856498 100644 --- a/code/nel/tools/pipeline/max/builtin/i_node.h +++ b/code/nel/tools/pipeline/max/builtin/i_node.h @@ -75,6 +75,11 @@ public: virtual void addChild(INode *node); virtual void removeChild(INode *node); // does not delete virtual const ucstring &userName() const; + + // dump + void dumpNodes(std::ostream &ostream, const std::string &pad = "") const; + + // read access /// The children that are linked to this node by the parent tag inline const std::set > &children() const { return m_Children; } diff --git a/code/nel/tools/pipeline/max/builtin/scene_impl.cpp b/code/nel/tools/pipeline/max/builtin/scene_impl.cpp index bd1e58307..4b6e5aef2 100644 --- a/code/nel/tools/pipeline/max/builtin/scene_impl.cpp +++ b/code/nel/tools/pipeline/max/builtin/scene_impl.cpp @@ -34,8 +34,6 @@ // #include // Project includes -#include "root_node.h" -#include "track_view_node.h" using namespace std; // using namespace NLMISC; diff --git a/code/nel/tools/pipeline/max/builtin/scene_impl.h b/code/nel/tools/pipeline/max/builtin/scene_impl.h index 62a712619..a88c0eeb6 100644 --- a/code/nel/tools/pipeline/max/builtin/scene_impl.h +++ b/code/nel/tools/pipeline/max/builtin/scene_impl.h @@ -36,13 +36,13 @@ // Project includes #include "reference_maker.h" +#include "root_node.h" +#include "track_view_node.h" + namespace PIPELINE { namespace MAX { namespace BUILTIN { -class CRootNode; -class CTrackViewNode; - /** * \brief CSceneImpl * \date 2012-08-22 08:53GMT @@ -76,6 +76,10 @@ public: virtual void setReference(uint index, CReferenceMaker *reference); virtual uint nbReferences() const; + // read access + inline CRootNode *rootNode() const { return m_RootNode; } + inline CTrackViewNode *trackViewNode() const { return m_TrackViewNode; } + protected: // inherited virtual IStorageObject *createChunkById(uint16 id, bool container); diff --git a/code/nel/tools/pipeline/max_dump/main.cpp b/code/nel/tools/pipeline/max_dump/main.cpp index e4df139f1..9df80bef2 100644 --- a/code/nel/tools/pipeline/max_dump/main.cpp +++ b/code/nel/tools/pipeline/max_dump/main.cpp @@ -30,9 +30,11 @@ // Testing #include "../max/builtin/storage/app_data.h" #include "../max/builtin/builtin.h" +#include "../max/builtin/scene_impl.h" +#include "../max/builtin/i_node.h" -//static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max"; -static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max"; +static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max"; +//static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/test2008.max"; //static const char *filename = "/home/kaetemi/3dsMax/scenes/teapot_test_scene.max"; static const char *streamname = "Scene"; @@ -174,6 +176,9 @@ int main(int argc, char **argv) //classDirectory3.toString(std::cout); //std::cout << "\n"; + std::cout << "\n"; + scene.container()->scene()->rootNode()->dumpNodes(std::cout); + std::cout << "\n"; // TEST APP DATA