Python/MEL obj export material errors

When I export OBJs with materials I get errors related to Mental Ray attributes that don't exist (I haven't used Mental Ray for years and the plugin isn't loaded). I'm using Maya 2019.1, and this error occurs using the MEL version of the command as well.

[code] cmds.file(dir + '{:03d}.obj', force = True, typ="OBJexport", es=True, op="groups=0; ptgroups=0; materials=1; smoothing=0; normals=0") [/code]

I get this error: [code]

Error: line 1: No object matches name: .ambientColor

Error: line 1: No object matches name: .normalCamera

[/code]

How can I export in a way that doesn't try to use these Mental Ray attributes?

Are you sure these are Mental Ray attributes? What material types are you using? Even a plain ol' Lambert has these attributes. It's strange that your exporter is complaining about them. Makes me wonder if something else is connected to these, and OBJ doesn't support them. As a test, what if you start a brand new scene, and create a cube and plain lambert material and try exporting that as obj. If that works, then the next step would be to look at all your scene materials to see if anything has a connection to these attributes.

The current version of Maya Bonus tools has a Clean UP Mental Ray script that removes MR related issues from the scene.

Hi, you can use the scene optimizer. The "delete or remove unknown node"

This topic was automatically closed after 87 days. New replies are no longer allowed.