From df79a1d6290b5ac49ab324ab0927d8cfee73b7c0 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 4 Mar 2003 19:31:38 +0000 Subject: [PATCH] no vertex color when textured --- pandatool/src/mayaegg/mayaToEggConverter.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index 0d888cc66c..23c08fb449 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -1224,6 +1224,13 @@ make_polyset(const MDagPath &dag_path, const MFnMesh &mesh, shader = default_shader; } + // Since a texture completely replaces a polygon or vertex color, + // we need to know up front whether we have a texture. + bool has_texture = false; + if (shader != (MayaShader *)NULL) { + has_texture = shader->_has_texture; + } + // Get the vertices for the polygon. long num_verts = pi.polygonVertexCount(); for (long i = 0; i < num_verts; i++) { @@ -1257,7 +1264,7 @@ make_polyset(const MDagPath &dag_path, const MFnMesh &mesh, } } - if (pi.hasColor()) { + if (pi.hasColor() && !has_texture) { MColor c; status = pi.getColor(c, i); if (!status) {