diff --git a/pandatool/src/maya/mayaShaderColorDef.cxx b/pandatool/src/maya/mayaShaderColorDef.cxx index d02055683b..a917cfacaa 100644 --- a/pandatool/src/maya/mayaShaderColorDef.cxx +++ b/pandatool/src/maya/mayaShaderColorDef.cxx @@ -331,8 +331,14 @@ read_surface_color(MayaShader *shader, MObject color, bool trans) { for (size_t j=0; jread_surface_color(shader, pla[j].node()); color_p->_texture_name.assign(pla[j].name().asChar()); @@ -342,7 +348,7 @@ read_surface_color(MayaShader *shader, MObject color, bool trans) { maya_cat.debug() << "uv_name : " << color_p->_texture_name << endl; } else { - maya_cat.debug() << pl.name() << " first:connectedTo: " << pla[j].name() << endl; + maya_cat.debug() << pl.name() << " first:connectedTo: " << pla_name << endl; read_surface_color(shader, pla[j].node()); _texture_name.assign(pla[j].name().asChar()); int loc = _texture_name.find('.',0); @@ -356,7 +362,7 @@ read_surface_color(MayaShader *shader, MObject color, bool trans) { MPlug pl_temp = pla[j]; MPlugArray pla_temp; pl_temp.connectedTo(pla_temp, true, false); - maya_cat.debug() << pl_temp.name() << "connectedTo:" << pla_temp.length() << " plugs\n"; + maya_cat.debug() << pl_temp.name() << " connectedTo:" << pla_temp.length() << " plugs\n"; } /* string blah; diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index a91f2b3274..7e6c6d0dc0 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -2283,15 +2283,17 @@ set_shader_attributes(EggPrimitive &primitive, const MayaShader &shader, const M // if multi-textured, first texture in maya is on top, so if (shader._color.size() > 1) { + // last shader on the list is the base one, which should always pick up the alpha + // from the texture file. But the top textures may have to strip the alpha if (i!=shader._color.size()-1) { // read the _alpha_is_luminance to figure out env_type if (!shader._alpha_is_luminance) tex.set_env_type(EggTexture::ET_decal); + // multitexture modulate mode may specify, desired alpha on/off + if (!color_def->_alpha_is_luminance) + tex.set_alpha_mode(EggRenderMode::AM_off); // Force alpha to be 'off' } if (color_def->_alpha_is_luminance) { - // multitexture modulate mode may specify, desired alpha on/off - if (color_def->_alpha_is_luminance) - tex.set_alpha_mode(EggRenderMode::AM_off); // Force alpha to be 'off' } } } else { // trans_def._has_texture