Browse Source

Fixed a transparency export bug

Josh Yelon 17 years ago
parent
commit
5547786f00
1 changed files with 4 additions and 10 deletions
  1. 4 10
      pandatool/src/maya/mayaShader.cxx

+ 4 - 10
pandatool/src/maya/mayaShader.cxx

@@ -299,19 +299,13 @@ calculate_pairings() {
     _all_maps[i]->_opposite = 0;
   }
   
-  bool using_color_alpha = (_trans_maps.size() > 0);
-  for (size_t i=0; i<_color_maps.size(); i++) {
-    if ((_color_maps[i]->_blend_type != MayaShaderColorDef::BT_modulate)&&
-        (_color_maps[i]->_blend_type != MayaShaderColorDef::BT_unspecified)) {
-      using_color_alpha = true;
-    }
-  }
+  bool using_transparency = (_trans_maps.size() > 0);
   
   for (int retry=0; retry<2; retry++) {
     bool perfect=(retry==0);
     for (size_t i=0; i<_color_maps.size(); i++) {
-      if ((_color_maps[i]->_blend_type != MayaShaderColorDef::BT_modulate)&&
-          (_color_maps[i]->_blend_type != MayaShaderColorDef::BT_unspecified)) {
+      if ((_color_maps[i]->_blend_type == MayaShaderColorDef::BT_modulate)||
+          (_color_maps[i]->_blend_type == MayaShaderColorDef::BT_unspecified)) {
         for (size_t j=0; j<_trans_maps.size(); j++) {
           try_pair(_color_maps[i], _trans_maps[j], perfect);
         }
@@ -319,7 +313,7 @@ calculate_pairings() {
     }
   }
   
-  if (!using_color_alpha) {
+  if (!using_transparency) {
     for (int retry=0; retry<2; retry++) {
       bool perfect=(retry==0);
       for (size_t i=0; i<_color_maps.size(); i++) {