Export model as a .FBX file using script, the model become colorless.

When exporting the model as an .fbx file manually it looks great, but when using code:
var ex=new DzFbxExporter();ex.writeFile(filename);
The model become colorless. The export setting for both of them were same. I can't figure out what's wrong with this.
Comments
You might benefit from looking at http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_fbx_silent/start