mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
support -expose properly
This commit is contained in:
parent
ad064f541f
commit
ec3b053c72
@ -135,7 +135,7 @@ run() {
|
|||||||
// The meat of the program: determine which joints are to be
|
// The meat of the program: determine which joints are to be
|
||||||
// removed, and then actually remove them.
|
// removed, and then actually remove them.
|
||||||
determine_removed_components();
|
determine_removed_components();
|
||||||
if (remove_joints()) {
|
if (process_joints()) {
|
||||||
do_reparent();
|
do_reparent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,15 +260,16 @@ determine_removed_components() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: EggOptchar::remove_joints
|
// Function: EggOptchar::process_joints
|
||||||
// Access: Private
|
// Access: Private
|
||||||
// Description: Effects the actual removal of joints flagged for
|
// Description: Effects the actual removal of joints flagged for
|
||||||
// removal by reparenting the hierarchy appropriately.
|
// removal by reparenting the hierarchy appropriately.
|
||||||
// Returns true if anything is done, false otherwise.
|
// Returns true if any joints are removed, false
|
||||||
|
// otherwise.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool EggOptchar::
|
bool EggOptchar::
|
||||||
remove_joints() {
|
process_joints() {
|
||||||
bool did_anything = false;
|
bool removed_any = false;
|
||||||
int num_characters = _collection->get_num_characters();
|
int num_characters = _collection->get_num_characters();
|
||||||
for (int ci = 0; ci < num_characters; ci++) {
|
for (int ci = 0; ci < num_characters; ci++) {
|
||||||
EggCharacterData *char_data = _collection->get_character(ci);
|
EggCharacterData *char_data = _collection->get_character(ci);
|
||||||
@ -303,12 +304,15 @@ remove_joints() {
|
|||||||
} else if ((user_data->_flags & EggOptcharUserData::F_empty) != 0) {
|
} else if ((user_data->_flags & EggOptcharUserData::F_empty) != 0) {
|
||||||
num_empty++;
|
num_empty++;
|
||||||
}
|
}
|
||||||
did_anything = true;
|
removed_any = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// This joint will be preserved, but maybe its parent will
|
// This joint will be preserved, but maybe its parent will
|
||||||
// change.
|
// change.
|
||||||
joint_data->reparent_to(best_parent);
|
joint_data->reparent_to(best_parent);
|
||||||
|
if ((user_data->_flags & EggOptcharUserData::F_expose) != 0) {
|
||||||
|
joint_data->expose();
|
||||||
|
}
|
||||||
num_kept++;
|
num_kept++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -324,7 +328,7 @@ remove_joints() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return did_anything;
|
return removed_any;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -53,7 +53,7 @@ private:
|
|||||||
static bool dispatch_vector_string_pair(const string &opt, const string &arg, void *var);
|
static bool dispatch_vector_string_pair(const string &opt, const string &arg, void *var);
|
||||||
|
|
||||||
void determine_removed_components();
|
void determine_removed_components();
|
||||||
bool remove_joints();
|
bool process_joints();
|
||||||
EggJointData *find_best_parent(EggJointData *joint_data) const;
|
EggJointData *find_best_parent(EggJointData *joint_data) const;
|
||||||
|
|
||||||
bool apply_user_reparents();
|
bool apply_user_reparents();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user