From 39e74cea5c8a39b6d6d038adb9679c2ac1915d46 Mon Sep 17 00:00:00 2001 From: Gyedo Jeon Date: Thu, 17 Jun 2010 00:36:08 +0000 Subject: [PATCH] Made all of the collision nodes to be added to a set --- pandatool/src/mayaegg/mayaEggLoader.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandatool/src/mayaegg/mayaEggLoader.cxx b/pandatool/src/mayaegg/mayaEggLoader.cxx index be5122db71..aed8b057e4 100755 --- a/pandatool/src/mayaegg/mayaEggLoader.cxx +++ b/pandatool/src/mayaegg/mayaEggLoader.cxx @@ -70,6 +70,7 @@ #include #include #include +#include #include "post_maya_include.h" #include "mayaEggLoader.h" @@ -133,6 +134,7 @@ public: private: int _unnamed_idx; + MSelectionList _collision_nodes; }; MPoint MakeMPoint(const LVector3d &vec) @@ -356,6 +358,9 @@ MayaEggGroup *MayaEggLoader::MakeGroup(EggGroup *group, EggGroup *context) result->_group = dgn.create("transform", MString(result->_name.c_str()), parent, &status); result->_addedEggFlag = false; + if (group->get_cs_type() != EggGroup::CST_none) + _collision_nodes.add(result->_group, true); + if (group->has_transform3d()) { LMatrix4d tMat = group->get_transform3d(); double matData[4][4] = {{tMat.get_cell(0,0), tMat.get_cell(0,1), tMat.get_cell(0,2), tMat.get_cell(0,3)}, @@ -1660,6 +1665,10 @@ bool MayaEggLoader::ConvertEggData(EggData *data, bool merge, bool model, bool a TraverseEggNode(data, NULL, ""); MStatus status; + + MFnSet collision_set; + collision_set.create(_collision_nodes, MFnSet::kNone, &status); + if (mayaloader_cat.is_spam()) { mayaloader_cat.spam() << "num meshes : " << _mesh_tab.size() << endl; }