diff --git a/pandatool/src/maya/mayaShader.cxx b/pandatool/src/maya/mayaShader.cxx index fc536809eb..8e99452068 100644 --- a/pandatool/src/maya/mayaShader.cxx +++ b/pandatool/src/maya/mayaShader.cxx @@ -284,27 +284,34 @@ bind_uvsets(MayaFileToUVSetMap &map) { void MayaShader:: calculate_pairings() { + if (_legacy_mode) { + return; + } + for (size_t i=0; i<_all_maps.size(); i++) { _all_maps[i]->_opposite = 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)) { - for (size_t j=0; j<_trans_maps.size(); j++) { - try_pair(_color_maps[i], _trans_maps[j], true); + 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)) { + for (size_t j=0; j<_trans_maps.size(); j++) { + try_pair(_color_maps[i], _trans_maps[j], perfect); + } } } - } - for (size_t i=0; i<_normal_maps.size(); i++) { - for (size_t j=0; j<_gloss_maps.size(); j++) { - try_pair(_normal_maps[i], _gloss_maps[j], true); + for (size_t i=0; i<_normal_maps.size(); i++) { + for (size_t j=0; j<_gloss_maps.size(); j++) { + try_pair(_normal_maps[i], _gloss_maps[j], perfect); + } } - } - if (_trans_maps.size() == 0) { - for (size_t i=0; i<_color_maps.size(); i++) { - for (size_t j=0; j<_glow_maps.size(); j++) { - try_pair(_color_maps[i], _glow_maps[j], true); + if (_trans_maps.size() == 0) { + for (size_t i=0; i<_color_maps.size(); i++) { + for (size_t j=0; j<_glow_maps.size(); j++) { + try_pair(_color_maps[i], _glow_maps[j], perfect); + } } } } diff --git a/pandatool/src/maya/mayaShaderColorDef.h b/pandatool/src/maya/mayaShaderColorDef.h index f4b9927278..03a622e584 100755 --- a/pandatool/src/maya/mayaShaderColorDef.h +++ b/pandatool/src/maya/mayaShaderColorDef.h @@ -129,8 +129,8 @@ private: friend class MayaShader; - // Deprecated Fields - these fields are only used by the - // deprecated codepath. These fields are deprecated for the + // Legacy Fields - these fields are only used by the + // legacy codepath. These fields are deprecated for the // following reasons: // // * has_texture is redundant --- if there's no