Fixed a bug I introduced last night

This commit is contained in:
Josh Yelon 2007-12-07 18:20:51 +00:00
parent c31a9d079c
commit 2ffa5786de
2 changed files with 23 additions and 16 deletions

View File

@ -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);
}
}
}
}

View File

@ -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