From ec3b053c729b023c93a659434900dcb6fe078229 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 21 Jul 2003 18:51:28 +0000 Subject: [PATCH] support -expose properly --- pandatool/src/egg-optchar/eggOptchar.cxx | 18 +++++++++++------- pandatool/src/egg-optchar/eggOptchar.h | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pandatool/src/egg-optchar/eggOptchar.cxx b/pandatool/src/egg-optchar/eggOptchar.cxx index 42af678f83..4ee189dc75 100644 --- a/pandatool/src/egg-optchar/eggOptchar.cxx +++ b/pandatool/src/egg-optchar/eggOptchar.cxx @@ -135,7 +135,7 @@ run() { // The meat of the program: determine which joints are to be // removed, and then actually remove them. determine_removed_components(); - if (remove_joints()) { + if (process_joints()) { do_reparent(); } @@ -260,15 +260,16 @@ determine_removed_components() { } //////////////////////////////////////////////////////////////////// -// Function: EggOptchar::remove_joints +// Function: EggOptchar::process_joints // Access: Private // Description: Effects the actual removal of joints flagged for // 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:: -remove_joints() { - bool did_anything = false; +process_joints() { + bool removed_any = false; int num_characters = _collection->get_num_characters(); for (int ci = 0; ci < num_characters; ci++) { EggCharacterData *char_data = _collection->get_character(ci); @@ -303,12 +304,15 @@ remove_joints() { } else if ((user_data->_flags & EggOptcharUserData::F_empty) != 0) { num_empty++; } - did_anything = true; + removed_any = true; } else { // This joint will be preserved, but maybe its parent will // change. joint_data->reparent_to(best_parent); + if ((user_data->_flags & EggOptcharUserData::F_expose) != 0) { + joint_data->expose(); + } num_kept++; } } @@ -324,7 +328,7 @@ remove_joints() { } } - return did_anything; + return removed_any; } //////////////////////////////////////////////////////////////////// diff --git a/pandatool/src/egg-optchar/eggOptchar.h b/pandatool/src/egg-optchar/eggOptchar.h index 6d9ec31b73..459841706f 100644 --- a/pandatool/src/egg-optchar/eggOptchar.h +++ b/pandatool/src/egg-optchar/eggOptchar.h @@ -53,7 +53,7 @@ private: static bool dispatch_vector_string_pair(const string &opt, const string &arg, void *var); void determine_removed_components(); - bool remove_joints(); + bool process_joints(); EggJointData *find_best_parent(EggJointData *joint_data) const; bool apply_user_reparents();