Welcome to the Maya Forum

Forum Moderators:  Lobo3433   

Maya F.A.Q (Updated: 2017 Feb 22 12:34 pm)


Maya Gallery

Checkout the Renderosity MarketPlace - Your source for digital art content!

 Subject: Exporting to obj

Nick85 opened this issue on Jul 03, 2013 · 8 posts

Top of Forum Unsubscribe Print

  Nick85    ( ) ( posted at 1:30PM Wed, 03 July 2013 

I am seeking some knowledge with exporting .mb Geometry and mapping to an obj file, I have the obj exporter enabled, all geometry is exporting correctly however the error is in the UV maps, they all are not exporting?

Any help would be appreciated

vr 2014 Free Trial

  Modulok    ( ) ( posted at 8:46PM Wed, 03 July 2013  · @4081710


Open the OBJ file in a text editor. Search for lines starting with 'vt' (it
stands for vertex texture, it's a UV coordinate.) They look like this::

vt 0.625000 0.000000

If present, the UV data is indeed in the OBJ file. However if you're looking
for raster UV snapshots to paint textures onto in Photoshop, etc, Maya does not
output these when exporting an OBJ. You have to output these on a per object
via the uv snapshot tool. It's found in under Window->UV Texture Editor ->
Polygons-> UV Snapshot... It works for the selected object.

If you have many objects to create snapshots for you can do this with a little
script via the command line or there many MEL scripts available from places
like creativecrash.com

If 'vt' isn't present in the OBJ file, this may be a limitation of the trial
version or the geometry you're trying to export has some funky UV sets, or no
UV's at all. Can you see the UV layout in Window -> UV Texture Editor for
selected objects?


  Nick85    ( ) ( posted at 8:03AM Thu, 04 July 2013  · @4081857

Thank you for your help, it seems I have my work cut out for me today ;)

  Nick85    ( ) ( posted at 2:28PM Sat, 06 July 2013  · @4083009

Yes I can see the maps via the UV layout window

  Nick85    ( ) ( posted at 3:03PM Sat, 06 July 2013  · @4083031

Bit confused how to get this exported iff info into the the main export ?

  Modulok    ( ) ( posted at 12:38AM Sun, 07 July 2013  · @4083332

Could you further describe what you're trying to do? What precisely do you mean
by "the error is in the UV maps, they all are not exporting"? What are you
trying to accomplish and what is the behavior you're expecting?

(The rest of this is based on a critical assumption...)

I'm going out on a limb here in assuming you're somewhat new to authoring OBJs.
If I've terribly misunderstood your problem or that's not the case, please
don't feel insulted! Here goes...

Basically raster maps i.e. jpg/tiff/iff textures, etc will never be part of an
OBJ file. (I assume this is what you mean by "get this exported iff info into
the main export".) The OBJ file format simply cannot hold image data. An OBJ
file by itself can only store the following::

  • vertices
  • vertex normals
  • UVs (but not textures themselves)
  • polygon groups
  • faces
  • references to MTL files.
  • A few other odds and ends.

When you ship a model in OBJ format you typically ship a zip-compressed folder
containing several files. For example if you're distributing a model and its
textures, i.e. selling on the Renderosity marketplace, you'll put the OBJ file
in a folder along side all the tiff/jpg texture files (whatever texture file
format your customers need) and the automatically generated MTL files. This
complete folder structure is what you'll ship.

MTL files are generated along side OBJ files. (In the Maya export options box
you can enable or disable the generation of MTL files.) MTL files do not
contain texture data. They contain shader data and references to texture
filenames. For example they define which object in an OBJ file is assigned,
what shader, along with some basic shader properties. For example 'Ks' in an
MTL file stands for specular color. There are also references to external
texture files, but no actual texture data itself is held in an MTL or an OBJ.

The UV snapshot files are textures like any others. Typically you'll export
these as tiff or jpg or png an put them into the same folder as the rest of
your textures. That way, if anyone wants to pain their own texture they can use
it as a template to know how the UV's are mapped. It's just a blueprint, not
the actual UV data. The UV data is in the OBJ file. You'll make a folder
structure something like this::

|-- README.txt
|-- LICENSE.txt
|-- sword_render.jpg
|-- sword.obj
|-- sword.mtl
|-- sword_uvsnapshot.tif
|-- sword_color.tif
|-- sword_normal.tif
|-- sword_reflect.tif
|-- sword_occlude.tif
`-- sword_diffuse.tif

The exact file layout depends on what your recipient requires. Your image
formats will also depend on whatever formats they can read. (Tiff is common.
Maya IFF should rarely be used because it is a file format that not many other
programs will read. A Maya IFF format is not the same as an Amiga IFF format.)
This entire structure defines your model and textures and UVs. When using OBJ,
no single file stores all the data. This is not a Maya limitation - it's
inherent to using OBJs.

Again, if I've completely misunderstood your problem, forgive me.

  Nick85    ( ) ( posted at 8:22AM Sun, 07 July 2013  · @4083462

Thanks for your help in stearing me into the right direction. Took a bit of sorting out as this was my first time around. In the end I ended up exporting what I could and remapped the rest, thks

  Modulok    ( ) ( posted at 12:17AM Mon, 08 July 2013  · @4083831


 To create a post you must first sign in or register an account.