David Rose 23 anos atrás
pai
commit
2cc9dbf7a1

+ 6 - 0
pandatool/src/converter/animationConvert.cxx

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

+ 1 - 0
pandatool/src/converter/animationConvert.h

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

+ 1 - 1
pandatool/src/eggbase/somethingToEgg.cxx

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

+ 9 - 0
pandatool/src/mayaegg/mayaToEggConverter.cxx

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