diff --git a/pandatool/src/mayaegg/mayaNodeDesc.cxx b/pandatool/src/mayaegg/mayaNodeDesc.cxx index ecf3ddd7d4..f5720399f9 100755 --- a/pandatool/src/mayaegg/mayaNodeDesc.cxx +++ b/pandatool/src/mayaegg/mayaNodeDesc.cxx @@ -182,10 +182,36 @@ check_pseudo_joints(bool joint_above) { // Don't bother traversing further if _joint_type is none, since // that means this node has no joint children. if (_joint_type != JT_none) { + + bool any_joints = false; Children::const_iterator ci; for (ci = _children.begin(); ci != _children.end(); ++ci) { MayaNodeDesc *child = (*ci); child->check_pseudo_joints(joint_above); + if (child->is_joint()) { + any_joints = true; + } + } + + // If any children qualify as joints, then any sibling nodes that + // are parents of joints are also elevated to joints. + if (any_joints) { + bool all_joints = true; + for (ci = _children.begin(); ci != _children.end(); ++ci) { + MayaNodeDesc *child = (*ci); + if (child->_joint_type == JT_joint_parent) { + child->_joint_type = JT_pseudo_joint; + } else if (child->_joint_type == JT_none) { + all_joints = false; + } + } + + if (all_joints) { + // Finally, if all children are joints, then we are too. + if (_joint_type == JT_joint_parent) { + _joint_type = JT_pseudo_joint; + } + } } } } diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index dde378db66..4b2daa87aa 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -440,8 +440,9 @@ convert_char_chan(double start_frame, double end_frame, double frame_inc, mayaegg_cat.debug(false) << "frame " << frame.value() << "\n"; } else { - mayaegg_cat.info(false) - << "."; + // We have to write to cerr instead of mayaegg_cat to allow + // flushing without writing a newline. + cerr << "." << flush; } MGlobal::viewFrame(frame);