From 60cbcbf78fa782b7de0a8d948aa645631550427d Mon Sep 17 00:00:00 2001 From: Gyedo Jeon Date: Thu, 18 Feb 2010 00:50:34 +0000 Subject: [PATCH] Fixed a bug of creating wrong joint hierarchy --- pandatool/src/mayaegg/mayaEggLoader.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandatool/src/mayaegg/mayaEggLoader.cxx b/pandatool/src/mayaegg/mayaEggLoader.cxx index 53c80d3722..b93cb67886 100755 --- a/pandatool/src/mayaegg/mayaEggLoader.cxx +++ b/pandatool/src/mayaegg/mayaEggLoader.cxx @@ -121,6 +121,8 @@ public: TexTable _tex_tab; SurfaceTable _surface_tab; + vector _joint_list; + int _start_frame; int _end_frame; int _frame_rate; @@ -502,6 +504,9 @@ MayaEggJoint *MayaEggLoader::MakeJoint(EggGroup *joint, EggGroup *context) } _joint_tab[joint] = result; + // [gjeon] since _joint_tab is not always properly sorted + _joint_list.push_back(result); + return result; } @@ -1809,8 +1814,8 @@ bool MayaEggLoader::ConvertEggData(EggData *data, bool merge, bool model, bool a mayaloader_cat.spam() << "thickness from joints: " << thickness << endl; } thickness = thickness * 0.025; - for (ji = _joint_tab.begin(); ji != _joint_tab.end(); ++ji) { - MayaEggJoint *joint = (*ji).second; + for (unsigned int i=0; i<_joint_list.size(); i++) { + MayaEggJoint *joint = _joint_list[i]; if (mayaloader_cat.is_spam()) { mayaloader_cat.spam() << "creating a joint: " << joint->_egg_joint->get_name() << endl; }