mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
add ac_pose
This commit is contained in:
parent
41828cfea9
commit
2cc9dbf7a1
@ -34,6 +34,9 @@ format_animation_convert(AnimationConvert convert) {
|
||||
case AC_none:
|
||||
return "none";
|
||||
|
||||
case AC_pose:
|
||||
return "pose";
|
||||
|
||||
case AC_flip:
|
||||
return "flip";
|
||||
}
|
||||
@ -61,6 +64,9 @@ string_animation_convert(const string &str) {
|
||||
if (cmp_nocase(str, "none") == 0) {
|
||||
return AC_none;
|
||||
|
||||
} else if (cmp_nocase(str, "pose") == 0) {
|
||||
return AC_pose;
|
||||
|
||||
} else if (cmp_nocase(str, "flip") == 0) {
|
||||
return AC_flip;
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
enum AnimationConvert {
|
||||
AC_invalid,
|
||||
AC_none,
|
||||
AC_pose,
|
||||
AC_flip,
|
||||
};
|
||||
|
||||
|
@ -107,7 +107,7 @@ add_animation_options() {
|
||||
("a", "animation-mode", 40,
|
||||
"Specifies how animation from the " + _format_name + " file is "
|
||||
"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);
|
||||
|
||||
add_option
|
||||
|
@ -215,11 +215,20 @@ convert_maya() {
|
||||
bool all_ok = true;
|
||||
|
||||
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:
|
||||
// none: just get out a static model, no animation.
|
||||
all_ok = convert_hierarchy(&get_egg_data());
|
||||
break;
|
||||
|
||||
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,
|
||||
output_frame_rate);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user