mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix problem with number of frames
This commit is contained in:
parent
5da93cd1d8
commit
9bd879333e
@ -71,8 +71,7 @@ EggTopstrip() {
|
|||||||
add_option
|
add_option
|
||||||
("r", "file.egg", 0,
|
("r", "file.egg", 0,
|
||||||
"Read the animation channel from the indicated egg file. If this "
|
"Read the animation channel from the indicated egg file. If this "
|
||||||
"is not specified, the first egg file named on the command line is "
|
"is not specified, each egg file will supply its own animation channel.",
|
||||||
"used.",
|
|
||||||
&EggTopstrip::dispatch_filename, NULL, &_channel_filename);
|
&EggTopstrip::dispatch_filename, NULL, &_channel_filename);
|
||||||
|
|
||||||
_invert_transform = true;
|
_invert_transform = true;
|
||||||
@ -161,7 +160,7 @@ run() {
|
|||||||
int num_children = root_joint->get_num_children();
|
int num_children = root_joint->get_num_children();
|
||||||
for (int i = 0; i < num_children; i++) {
|
for (int i = 0; i < num_children; i++) {
|
||||||
EggJointData *joint_data = root_joint->get_child(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
|
// We also need to transform the vertices for any models involved
|
||||||
@ -231,7 +230,9 @@ check_transform_channels() {
|
|||||||
// joint_data.
|
// joint_data.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void EggTopstrip::
|
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();
|
int num_models = joint_data->get_num_models();
|
||||||
for (int i = 0; i < num_models; i++) {
|
for (int i = 0; i < num_models; i++) {
|
||||||
int model = (from_model < 0) ? i : from_model;
|
int model = (from_model < 0) ? i : from_model;
|
||||||
@ -243,8 +244,8 @@ strip_anim(EggJointData *joint_data, int from_model, EggJointData *top_joint) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int num_into_frames = joint_data->get_num_frames(i);
|
int num_into_frames = char_data->get_num_frames(i);
|
||||||
int num_from_frames = top_joint->get_num_frames(model);
|
int num_from_frames = from_char->get_num_frames(model);
|
||||||
|
|
||||||
int num_frames = max(num_into_frames, num_from_frames);
|
int num_frames = max(num_into_frames, num_from_frames);
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "pvector.h"
|
#include "pvector.h"
|
||||||
|
|
||||||
|
class EggCharacterData;
|
||||||
class EggJointData;
|
class EggJointData;
|
||||||
class EggJointPointer;
|
class EggJointPointer;
|
||||||
|
|
||||||
@ -44,7 +45,8 @@ public:
|
|||||||
void run();
|
void run();
|
||||||
void check_transform_channels();
|
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);
|
EggJointData *top_joint);
|
||||||
void strip_anim_vertices(EggNode *egg_node, int into_model,
|
void strip_anim_vertices(EggNode *egg_node, int into_model,
|
||||||
int from_model, EggJointData *top_joint);
|
int from_model, EggJointData *top_joint);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user