Search code examples
autodesk-forgeautodesk-viewerautodesk-model-derivative

The color scheme shown is wrong in the viewer after translation of a zip file( containing .obj and .mat )


I have an obj file & a material file for it that defines the color scheme I require. When I zip these two and send it for translation and view the translated model in viewer I can see the colors are not the ones I am expecting. When I open this obj file in Meshlab I am able to see the colors correctly.

Snapshots from Meshlab. (#expected)enter image description here

Snapshots from Meshlab. (#expected)enter image description here

What I saw in Forge viewer after translation. (#Wrong result)enter image description here

(#Wrong result)enter image description here

(#Wrong result)enter image description here


Solution

  • Below are my .mat file contents(materials) that obj file uses.

    newmtl mat0
    Ka 1.00 1.00 1.00
    Kd 0.3333333333333333 1.0 1.0
    Killum 1
    newmtl mat1
    Ka 1.00 1.00 1.00
    Kd 1.0 1.0 0.4980392156862745
    Killum 1
    newmtl mat2
    Ka 1.00 1.00 1.00
    Kd 0.3333333333333333 0.6666666666666666 1.0
    Killum 1
    newmtl mat3
    Ka 1.00 1.00 1.00
    Kd 1.0, 0.6666666666666666, 0.0
    Killum 1
    newmtl mat4
    Ka 1.00 1.00 1.00
    Kd 1.0, 0.3333333333333333, 1.0
    Killum 1
    newmtl mat5
    Ka 1.00 1.00 1.00
    Kd 1.0, 0.0, 0.0
    Killum 1
    

    here In lines

    Kd 1.0, 0.6666666666666666, 0.0
    &
    Kd 1.0, 0.3333333333333333, 1.0
    &
    Kd 1.0, 0.0, 0.0
    

    when I removed the comas color scheme started to work as expected.