Welcome to the Maya Forum

Forum Moderators: nemirc, Modulok

Maya F.A.Q. (last updated 2007-08-14 14:27:14)


 

Maya Gallery

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

Subject: Exporting to obj

Author
Message

Nick85  

Homepage »

Stats

Back to Top

Posted Wed, Jul 3, 2013 1:30 pm

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

Quote  Report Print Save

Modulok  

Forum Moderator

Homepage »

Stats

Back to Top

Posted Wed, Jul 3, 2013 8:46 pm

Hmm...


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?


-Modulok-

____________________
By God, we're gonna do something about nothing.

Quote  Report Print Save

Nick85  

Homepage »

Stats

Back to Top

Posted Thu, Jul 4, 2013 8:03 am

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

Quote  Report Print Save

Nick85  

Homepage »

Stats

Back to Top

Posted Sat, Jul 6, 2013 2:28 pm

Yes I can see the maps via the UV layout window

Quote  Report Print Save

Nick85  

Homepage »

Stats

Back to Top

Posted Sat, Jul 6, 2013 3:03 pm

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

Quote  Report Print Save

Modulok  

Forum Moderator

Homepage »

Stats

Back to Top

Posted Sun, Jul 7, 2013 12:38 am

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::


sword/
|-- 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.
-Modulok-

____________________
By God, we're gonna do something about nothing.

Quote  Report Print Save

Nick85  

Homepage »

Stats

Back to Top

Posted Sun, Jul 7, 2013 8:22 am

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

Quote  Report Print Save

Modulok  

Forum Moderator

Homepage »

Stats

Back to Top

Posted Mon, Jul 8, 2013 12:17 am

:)

____________________
By God, we're gonna do something about nothing.

Quote  Report Print Save

Unread Post(s) Unread Announcement You are a visitor.

You cannot post new threads.
You cannot reply to threads.
You cannot edit your posts.
You cannot delete your posts.
Read Post(s) Read Announcement
Unread Post(s) (Locked) Unread Sticky
Read Post(s) (Locked) Read Sticky
 
Powered by Bondware
Newspaper Software | Email Marketing Tools | E-Commerce Marketplace