瀏覽代碼

allow -drop to override -keepall

David Rose 22 年之前
父節點
當前提交
1f2e53d747
共有 1 個文件被更改,包括 8 次插入7 次删除
  1. 8 7
      pandatool/src/egg-optchar/eggOptchar.cxx

+ 8 - 7
pandatool/src/egg-optchar/eggOptchar.cxx

@@ -113,7 +113,8 @@ EggOptchar() {
 
   add_option
     ("keepall", "", 0,
-     "Keep all joints and sliders in the character.",
+     "Keep all joints and sliders in the character, except those named "
+     "explicitly by -drop.",
      &EggOptchar::dispatch_none, &_keep_all);
   
   add_option
@@ -428,7 +429,12 @@ determine_removed_components() {
       nassertv(user_data != (EggOptcharUserData *)NULL);
 
       const string &name = comp_data->get_name();
-      if (_keep_all || keep_names.find(name) != keep_names.end()) {
+      if (drop_names.find(name) != drop_names.end()) {
+        // Remove this component by user request.
+        names_used.insert(name);
+        user_data->_flags |= EggOptcharUserData::F_remove;
+
+      } else if (_keep_all || keep_names.find(name) != keep_names.end()) {
         // Keep this component.
         names_used.insert(name);
 
@@ -437,11 +443,6 @@ determine_removed_components() {
           user_data->_flags |= EggOptcharUserData::F_expose;
         }
 
-      } else if (drop_names.find(name) != drop_names.end()) {
-        // Remove this component by user request.
-        names_used.insert(name);
-        user_data->_flags |= EggOptcharUserData::F_remove;
-
       } else {
         // Remove this component if it's unanimated or empty.
         if ((user_data->_flags & (EggOptcharUserData::F_static | EggOptcharUserData::F_empty)) != 0) {