SahelFllh / opencollada

Automatically exported from code.google.com/p/opencollada
0 stars 0 forks source link

Vertex color indexes are not exported correctly #100

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In GeometryPolygonExporter::writeVertexIndices, the Idx from vertex attributes 
is used to lookup color set name despite the fact it is always set to -1. The 
result is index is always 0. I've hardcoded the index to be 0 for color, and it 
fixes the problem, but only works with on colorset.

Any ideas on how to fix it properly?

Code that behave incorrectly :
case COLLADASW::COLOR:
{
    MString& colorSetName = mColorSetNames[vertexAttributes.getIdx()];
    int colorIndex = 0;
    {
#if MAYA_API_VERSION >= 700
        fnMesh.getColorIndex ( polyIndex, iteratorVertexIndex, colorIndex, &colorSetName );
#else
        fnMesh.getFaceVertexColorIndex ( polyIndex, iteratorVertexIndex, colorIndex );
#endif
    }
    primitivesBasePoly->appendValues ( colorIndex );
}
break;

Original issue reported on code.google.com by julien.hamaide on 10 Aug 2010 at 1:20

GoogleCodeExporter commented 9 years ago
Here's a patch that correct this bug

Original comment by julien.hamaide on 11 Aug 2010 at 9:07

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by opencollada2@googlemail.com on 25 Jan 2011 at 12:19