From 9bd879333ee6dbd107e7c49c2dcf6cee75e14a1b Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 11 Dec 2003 01:37:59 +0000 Subject: [PATCH] fix problem with number of frames --- pandatool/src/eggprogs/eggTopstrip.cxx | 13 +++++++------ pandatool/src/eggprogs/eggTopstrip.h | 4 +++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pandatool/src/eggprogs/eggTopstrip.cxx b/pandatool/src/eggprogs/eggTopstrip.cxx index f7d4faaa7d..b78102b04d 100644 --- a/pandatool/src/eggprogs/eggTopstrip.cxx +++ b/pandatool/src/eggprogs/eggTopstrip.cxx @@ -71,8 +71,7 @@ EggTopstrip() { add_option ("r", "file.egg", 0, "Read the animation channel from the indicated egg file. If this " - "is not specified, the first egg file named on the command line is " - "used.", + "is not specified, each egg file will supply its own animation channel.", &EggTopstrip::dispatch_filename, NULL, &_channel_filename); _invert_transform = true; @@ -161,7 +160,7 @@ run() { int num_children = root_joint->get_num_children(); for (int i = 0; i < num_children; i++) { EggJointData *joint_data = root_joint->get_child(i); - strip_anim(joint_data, from_model, top_joint); + strip_anim(char_data, joint_data, from_model, from_char, top_joint); } // We also need to transform the vertices for any models involved @@ -231,7 +230,9 @@ check_transform_channels() { // joint_data. //////////////////////////////////////////////////////////////////// void EggTopstrip:: -strip_anim(EggJointData *joint_data, int from_model, EggJointData *top_joint) { +strip_anim(EggCharacterData *char_data, EggJointData *joint_data, + int from_model, EggCharacterData *from_char, + EggJointData *top_joint) { int num_models = joint_data->get_num_models(); for (int i = 0; i < num_models; i++) { int model = (from_model < 0) ? i : from_model; @@ -243,8 +244,8 @@ strip_anim(EggJointData *joint_data, int from_model, EggJointData *top_joint) { return; } - int num_into_frames = joint_data->get_num_frames(i); - int num_from_frames = top_joint->get_num_frames(model); + int num_into_frames = char_data->get_num_frames(i); + int num_from_frames = from_char->get_num_frames(model); int num_frames = max(num_into_frames, num_from_frames); diff --git a/pandatool/src/eggprogs/eggTopstrip.h b/pandatool/src/eggprogs/eggTopstrip.h index a401af1f4c..6399c9dfff 100644 --- a/pandatool/src/eggprogs/eggTopstrip.h +++ b/pandatool/src/eggprogs/eggTopstrip.h @@ -26,6 +26,7 @@ #include "pvector.h" +class EggCharacterData; class EggJointData; class EggJointPointer; @@ -44,7 +45,8 @@ public: void run(); void check_transform_channels(); - void strip_anim(EggJointData *joint_data, int from_model, + void strip_anim(EggCharacterData *char_data, EggJointData *joint_data, + int from_model, EggCharacterData *from_char, EggJointData *top_joint); void strip_anim_vertices(EggNode *egg_node, int into_model, int from_model, EggJointData *top_joint);