PDA

View Full Version : Keeping UVs when import/export obj files



daverj
02-08-2004, 03:38 PM
If I import a .obj file in LW7.5 the UV maps come into LW. If I then modify the geometry a bit and export as .obj format I lose all the UVs from the original file.

The way around this seems to be that after importing the .obj file I have to go to the Surface Editor and one by one select each surface and click the "T" next to the Color channel (or any channel) to add a texture map image. Then set the map to UV projection and select the default UV map (that loaded with the .obj) from the drop down list. It seems that I don't even have to assign an image, just have to set that surface to use the UVs from the default map in the file.

Only surfaces that have been assigned this way so they actually use the UVs will then be exported as UVs when exporting an .obj file.

That's not too bad if there is only one surface in the model, but if there are a dozen or more surfaces then it takes a while to get them all set up as texture mapped just to get the UVs to export.

Is there a simpler way to do this? Perhaps a plugin that automatically assigns all surfaces to the default UV map?

mkiii
02-08-2004, 03:48 PM
Not automatic, but nearly:

All you need to do is CTRL or SHIFT+Select all the surfaces that require the UV Map to be set, Click on the T of the Color Line to get the Texture Editor panel open, and set the Projection, UVMap & Image to what you need.

So long as you don't alter any other settings, they will remain as they were, but all the UV Maps, and Images will be set the same for each surface you had selected.

Sounds long winded, but it's just a couple of clicks.

daverj
02-08-2004, 07:34 PM
Hmmmm.....

I had tried ctrl click and shift click in the Surface editor's Surface Name list and it didn't seem to work to select multiple surfaces. I just tried it again and I see that I was fooled by the fact that only the name I last clicked on is highlighted but it does say "Surfaces Selected: 24", so I guess they were actually selected.

I was confused because the ones I selected didn't (and still don't) show up as highlighted in the list of surface names. Only the last one I clicked on is highlighted. That is pretty stupid, and makes it hard to tell which ones are selected when more than one is selected.

But it does solve my problem. Thanks a lot!

kscholten
12-12-2007, 11:50 AM
I seem to have the same problem - my uv info is not exporting with my .obj files - but none of these solutions are working for me!

Are there any other solutions to this problem? I can see that the surface names have exported, but no color, maps etc.

For the record I am trying to import into 3dmax 8, but for troubleshooting purposes I am loading the object files back into LW 8.3 to see if the info is there (it isn't).

Thank you for your assistance!

IMI
12-12-2007, 05:51 PM
I seem to have the same problem - my uv info is not exporting with my .obj files - but none of these solutions are working for me!

Are there any other solutions to this problem? I can see that the surface names have exported, but no color, maps etc.

For the record I am trying to import into 3dmax 8, but for troubleshooting purposes I am loading the object files back into LW 8.3 to see if the info is there (it isn't).

Thank you for your assistance!


It should be. make sure you have the UV map applied to the object in the surface editor. That will insure that the UV map is exported along with the OBJ data.

But, if you mean that not ALL of the UV maps are being exported....
LightWave's OBJ export is not that good. It doesn't make a MTL file, for one thing, but worse, it will only export the first UV map in the list of UV maps.
This is in the case that an object has multiple UV maps for it.
To get around that you can either save as .lwo and convert it to OBJ with a good file converter such as AccuTrans or Deep Exploration (the easy way) or copy and paste your separate maps all into one, then move them around so they aren't overlapping.

99sproth
12-12-2007, 06:31 PM
Why is the obj export so bad?

Obj is the most basic type on 3d file... just open one up in notepad++ and look, just vertices, polys and uvs. I wrote a obj export for my own graphics package and it took about an hour (and that included learning how the format works).

If they only want it to export specified uvs why not bring up a dialog asking the user to specify the maps he wants?

IMI
12-13-2007, 02:45 AM
Why is the obj export so bad?

Obj is the most basic type on 3d file... just open one up in notepad++ and look, just vertices, polys and uvs. I wrote a obj export for my own graphics package and it took about an hour (and that included learning how the format works).

If they only want it to export specified uvs why not bring up a dialog asking the user to specify the maps he wants?


I certainly couldn't tell you why they didn't write it better...
So you know then that the OBJ fordmat can only handle one UV map, or rather only one layer of UV's. I'm not sure if that's the right way to put it, but I imagine you know what I mean.
When you export as OBj from LW, you could have an object with, say, 3 different UV maps for 3 different parts or surfaces. In the vertex panel, they're listed from top down, based on whichever was created first. So when you export as OBJ, assuming the UV's are applied in the surface editor, only that first set of UV coordinates will get exported along with it.
I used to think that's all you get, that's all th OBJ format can deal with, and go through the process of copying and pasting UV's, but found out that saving as lwo and then using Deep Exploration to convert to OBJ will retain ALL those maps, in one layer, or however you would say it. The bottom line is, they're all there when done that way.
And of course, LW doesn't even create a s imple mtl file to go along with the export. Again, you'd have to convert it with a good program to get that.
Considering the universal nature of the OBJ format, you'd think they'd have chosen to do it up right by now, but they haven't and "why?" is a good question. ;)

kscholten
12-13-2007, 10:50 AM
I am using Deep Exploration to convert and it seems to be working! Thank you so much for your advice!