be more aggressive in making groups into joints

This commit is contained in:
David Rose 2003-08-20 19:11:23 +00:00
parent 0d74d793cb
commit caad2ce9bb
2 changed files with 29 additions and 2 deletions

View File

@ -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;
}
}
}
}
}

View File

@ -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);