add ac_pose

This commit is contained in:
David Rose 2003-01-21 23:58:45 +00:00
parent 41828cfea9
commit 2cc9dbf7a1
4 changed files with 17 additions and 1 deletions

View File

@ -34,6 +34,9 @@ format_animation_convert(AnimationConvert convert) {
case AC_none: case AC_none:
return "none"; return "none";
case AC_pose:
return "pose";
case AC_flip: case AC_flip:
return "flip"; return "flip";
} }
@ -61,6 +64,9 @@ string_animation_convert(const string &str) {
if (cmp_nocase(str, "none") == 0) { if (cmp_nocase(str, "none") == 0) {
return AC_none; return AC_none;
} else if (cmp_nocase(str, "pose") == 0) {
return AC_pose;
} else if (cmp_nocase(str, "flip") == 0) { } else if (cmp_nocase(str, "flip") == 0) {
return AC_flip; return AC_flip;

View File

@ -30,6 +30,7 @@
enum AnimationConvert { enum AnimationConvert {
AC_invalid, AC_invalid,
AC_none, AC_none,
AC_pose,
AC_flip, AC_flip,
}; };

View File

@ -107,7 +107,7 @@ add_animation_options() {
("a", "animation-mode", 40, ("a", "animation-mode", 40,
"Specifies how animation from the " + _format_name + " file is " "Specifies how animation from the " + _format_name + " file is "
"converted to egg, if at all. At present, the following keywords " "converted to egg, if at all. At present, the following keywords "
"are supported: none and flip.", "are supported: none, pose, or flip.",
&SomethingToEgg::dispatch_animation_convert, NULL, &_animation_convert); &SomethingToEgg::dispatch_animation_convert, NULL, &_animation_convert);
add_option add_option

View File

@ -215,11 +215,20 @@ convert_maya() {
bool all_ok = true; bool all_ok = true;
switch (get_animation_convert()) { switch (get_animation_convert()) {
case AC_pose:
// pose: set to a specific frame, then get out the static geometry.
nout << "frame " << start_frame << "\n";
MGlobal::viewFrame(MTime(start_frame, MTime::uiUnit()));
// fall through
case AC_none: case AC_none:
// none: just get out a static model, no animation.
all_ok = convert_hierarchy(&get_egg_data()); all_ok = convert_hierarchy(&get_egg_data());
break; break;
case AC_flip: case AC_flip:
// flip: get out a series of static models, one per frame, under a
// sequence node.
all_ok = convert_flip(start_frame, end_frame, frame_inc, all_ok = convert_flip(start_frame, end_frame, frame_inc,
output_frame_rate); output_frame_rate);
break; break;