Notifications
Clear all

[Closed] obj import, please help

Sorry for the duplicate post. I put this question in the wrong section of the forum.

I am importing an .obj mesh via maxscript, using #noprompt. The mesh comes in fine, but without the materials contained in the assocated .mtl file. Does anyone know how to access the parameters in the .obj importer plugin or can someone tell me how to script the import so that the materials are imported with the model and automatically assigned to the model, as the importer plugin does? Any help will be greatly appreciated. Thank you for taking the time to read this post.

-gk

7 Replies

Try playing with the importer settings

That importer can not be parameterized via MaxScript.

It will use the settings from the “last time” it was used by a user. So if someone imports an OBJ with materials turn on, and then runs your script. It will use materials. If next they use that importer and turn off materials and run your script. It will not load them.

It’s really stupid I know.

Forcing a 3D Studio Max reset at the start of your script will force the OBJ importer to revert to it’s defaults.

Depending on the environment you are doing this in, a solution would be to overwrite the obj importer settings file before entering importing. In 3dsmax 8 this is located in:

c:\Program Files\Autodesk\3dsMax8\plugcfg\obj2max.cfg

That’s a cool idea. Thanks.

Instead of overwriting, just edit the file via script. obj2max.cfg is formated like an INI file.

setINISetting ((GetDir #plugcfg) + "\\obj2max.cfg") "Obj2Max" "Materials" "1"

That’s an even cooler idea. Thanks.

Thanks guys,

I’ve been away for a bit. I will try this tonight. Thanks again.

-gk