瀏覽代碼

no vertex color when textured

David Rose 23 年之前
父節點
當前提交
df79a1d629
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      pandatool/src/mayaegg/mayaToEggConverter.cxx

+ 8 - 1
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) {