Pārlūkot izejas kodu

apply_animation_parameters

David Rose 23 gadi atpakaļ
vecāks
revīzija
a6bfc2a8a9

+ 1 - 1
pandatool/src/eggbase/Sources.pp

@@ -1,7 +1,7 @@
 #begin ss_lib_target
   #define TARGET eggbase
   #define LOCAL_LIBS \
-    progbase
+    progbase converter
   #define OTHER_LIBS \
     egg:c linmath:c panda:m
     

+ 31 - 0
pandatool/src/eggbase/somethingToEgg.cxx

@@ -317,6 +317,37 @@ apply_units_scale(EggData &data) {
   }
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: SomethingToEgg::apply_animation_parameters
+//       Access: Protected
+//  Description: Copies the animation parameters specified by the user
+//               on the command line (if add_animation_options() was
+//               used) to the converter.
+////////////////////////////////////////////////////////////////////
+void SomethingToEgg::
+apply_animation_parameters(SomethingToEggConverter &converter) {
+  converter.set_animation_convert(_animation_convert);
+  converter.set_character_name(_character_name);
+  if (_got_start_frame) {
+    converter.set_start_frame(_start_frame);
+  }
+  if (_got_end_frame) {
+    converter.set_end_frame(_end_frame);
+  }
+  if (_got_frame_inc) {
+    converter.set_frame_inc(_frame_inc);
+  }
+  if (_got_neutral_frame) {
+    converter.set_neutral_frame(_neutral_frame);
+  }
+  if (_got_input_frame_rate) {
+    converter.set_input_frame_rate(_input_frame_rate);
+  }
+  if (_got_output_frame_rate) {
+    converter.set_output_frame_rate(_output_frame_rate);
+  }
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: SomethingToEgg::handle_args
 //       Access: Protected

+ 4 - 3
pandatool/src/eggbase/somethingToEgg.h

@@ -19,12 +19,12 @@
 #ifndef SOMETHINGTOEGG_H
 #define SOMETHINGTOEGG_H
 
-#include <pandatoolbase.h>
+#include "pandatoolbase.h"
 
 #include "eggConverter.h"
 
-#include <distanceUnit.h>
-#include <somethingToEggConverter.h>
+#include "distanceUnit.h"
+#include "somethingToEggConverter.h"
 
 
 ////////////////////////////////////////////////////////////////////
@@ -50,6 +50,7 @@ public:
 
 protected:
   void apply_units_scale(EggData &data);
+  void apply_animation_parameters(SomethingToEggConverter &converter);
 
   virtual bool handle_args(Args &args);
   virtual bool post_command_line();

+ 1 - 20
pandatool/src/mayaprogs/mayaToEgg.cxx

@@ -99,26 +99,7 @@ run() {
   converter._ignore_transforms = _ignore_transforms;
 
   // Copy in the animation parameters.
-  converter.set_animation_convert(_animation_convert);
-  converter.set_character_name(_character_name);
-  if (_got_start_frame) {
-    converter.set_start_frame(_start_frame);
-  }
-  if (_got_end_frame) {
-    converter.set_end_frame(_end_frame);
-  }
-  if (_got_frame_inc) {
-    converter.set_frame_inc(_frame_inc);
-  }
-  if (_got_neutral_frame) {
-    converter.set_neutral_frame(_neutral_frame);
-  }
-  if (_got_input_frame_rate) {
-    converter.set_input_frame_rate(_input_frame_rate);
-  }
-  if (_got_output_frame_rate) {
-    converter.set_output_frame_rate(_output_frame_rate);
-  }
+  apply_animation_parameters(converter);
 
   // Set the coordinate system to match Maya's.
   if (!_got_coordinate_system) {