mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix problem with number of frames
This commit is contained in:
parent
5da93cd1d8
commit
9bd879333e
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user