Question

I'm a physics programmer and new to maya, specifically I'm using maya 2013. I need to export wavefront obj model without uv information. something like this:

f 5154//3739 3815//3481 3818//3903
f 5147//4019 2167//3675 3813//3861
f 2166//4496 5147//4019 2175//4542

or

f 99793/99793 99779/99779 99778/99778 99792/99792 
f 99794/99794 99780/99780 99779/99779 99793/99793 
f 99795/99795 99781/99781 99780/99780 99794/99794 

But when I used maya's objexport plugin, it contains uv information which I don't want in the obj files. Since I have a legacy code which reads obj files and do some job on it. When it includes uv information, such as:

f 4942/8293/6766 4975/10045/6799 4943/10046/6767
f 4943/10047/6767 4975/10048/6799 4976/10049/6800
f 4943/8294/6767 4976/10050/6800 4944/10051/6768

the code won't function properly. I don't want to modify the code, it works for most obj files without the uv stuff.

So could anybody tell me how to export obj model without uv information from maya?

Thanks.

Était-ce utile?

La solution

Returning your first example is pretty simple, your second format I don't believe is possible straight out from maya, but this would be achievable with a bash script or many other regex scripts, for your first required output:

PyMel: in the script editor, just select your obj(s) and run this code:

from pymel.core import *

for object in selected():
    polyMapDel(object.f)

File > Export > OBJExport:

Result:

f 9//25 10//26 12//27 11//28
f 11//29 12//30 14//31 13//32
f 13//33 14//34 16//35 15//36

Or to do this without the use of a script, simply select the model and change your menu set to 'Polygons', in the 'Edit UVs' menu, you will see toward the bottom, 'Delete UVs'.

This above will also return the same result, Hope this helps

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top