PDA

View Full Version : Beyond the OBJ plugin


walasek
01-22-2003, 04:24 AM
First, let me say I think this forum is a good idea. I just hope it lasts. Also, I am a programmer by nature. I have hardly modelled, textured, or animated anything at all. I enjoy programming, at it seems that some of my talents are useful here.

This is a post I put on the AM mailing list. I did get very good response, but I also found out other ways of doing decals and uv mapping without flattening. Tell me what you think of this idea...

While doing the .OBJ plugin, I got my first taste of trying to create the maps used for models (I have never done that before and always thought of it as out of my reach). After playing with the .obj plugin, deeppaint, uvmappers and the such, I now have a better understanding of how this is done - well, how its done outside of AM.

My question is this... How is this effectively done in AM? How are the UV Maps created (I'm assuming by flattening and then applying the texture)? How do you effectively paint on the map? Do you just keep passing it back and forth to a paint program, making changes, and seeing how it looks in AM? If so, this seems quite tedious, and seems that there must be a better way. Especially after playing around with Deep Paint and ZBrush. If I am wrong here, someone please correct me. Also, flattening always has been very confusing to me, but then again, so was trying to get UV coordinates.

It seems to me that if I could paint on the model itself, like we do in Deep Paint or ZBrush, then the artist (and you are definitely artists) would have an easier time trying to do this (especially amateur's like myself). With the new .OBJ plugin, you can export, uvmap, paint, import, but this has some flaws. First, when you import, you are working with a new imported model, and the splines may not be the way you want them - basically because AM is trying to create splines from the polygon models. Second, AM has a much better way of handling uv coordinates and maps then the .obj file format does (in AM each map gets a unique set of uv coordinates for each map - in .obj a uv coordinate for a face must be shared among all maps). In AM I could have a bump map that covers the whole model, while having different color maps covering different parts of the model - I couldn't do that with the .OBJ format.

What I'm wondering is this: Would it be useful to have a type of .OBJ exporter/importer that would read the uv coordinates and maps into an existing model (or part of model), without destroying your current splines. Basically, you could select a group of faces in the model (say an arm or something), export out all the info (as a .OBJ file), UV map it, paint on it (using a program like DeepPaint/ZBrush), and then just import back the uv coordinates and the map that you painted. You could even import multiple uv's and multiple maps for color, specular, ambiance, diffuse, and bump maps. Would this make this job any easier? Would people need/want a plugin/wizard like this?

This would basically be an extension to the .OBJ plugin, allowing a sort of texture wizard option...

Let me know, and correct me if there is a good way of doing this in AM - again, I'm new to all this texture stuff :)

Arthur Walasek
Email: awalasek@attbi.com

JTalbotski
01-22-2003, 04:45 AM
Your idea sounds like it would eliminate the smearing of some decals that happens when you flatten a mesh in a pose, apply a decal and then see it on the unflattened model. It would help me a lot to decal the hair area onto a head without the hair strands blurring.

(I realize as I write this that you probably program for the PC only and that any hope of me being able to use this is if Ken ports it to the Mac. Am I right?)

I've never used ZBrush. Is it easy to paint on a 3D model?

In A:M. I usually screen capture the mesh when it is flattened in a pose window, bring that capture into Photoshop, save it as a tga and apply that tga onto the flattened mesh, using the spline lines in the tga to line up the image to the model. Usually, if you don't resize the pose window, the tga appears right where you want it to be.

Then just go to Photoshop and make the spline image into a layer and set it to multiply and paint under it on a separate layer. Then resave as the same name of the original tga. A:M will update it when you render it next time. A little tedious., but it works well.

zandoria
01-22-2003, 05:04 AM
There has been a UV editor in A:M since V9(a version that will live in infamy), but there hasn't been much documentation..

Anyway here is a tutorial on using the built-in UV editor to decal a face, no flattening required!

http://www.zandoria.com/uv

JTalbotski
01-22-2003, 05:06 AM
Originally posted by zandoria
There has been a UV editor in A:M since V9(a version that will live in infamy), but there hasn't been much documentation..

Anyway here is a tutorial on using the built-in UV editor to decal a face, no flattening required!

http://www.zandoria.com/uv


I get a dead link with that url.

JTalbotski
01-22-2003, 05:08 AM
Originally posted by JTalbotski
I get a dead link with that url.


Okay I got it. Add a .htm after the uv.

zandoria
01-22-2003, 05:12 AM
oops, try this one:
http://www.zandoria.com/uv.htm
:rolleyes:

JTalbotski
01-22-2003, 05:14 AM
Cool, William! Thanks for sharing. Nice tute.

My Fault
01-22-2003, 05:46 AM
It's funny to think that in AM's old days they had rudimentary 3d painting. Martin ditched it many, many moons ago.

Great tute William and a great plug-in Arthur!

walasek
01-22-2003, 06:04 AM
Well, since I found out this new UV mapping stuff in AM (thanks William), I think I will focus on other projects.

Is there a need for an OBJ exporter that supports UV coords and maps from AM. If so, I hope you realize that AM decalling is more advanced then the OBJ format allows (multiple uv coords per face), and that the exporter would have to sacrifice some UV coords in place of others...

jaymackey
01-22-2003, 06:14 AM
Thanks William for the UV tutorial.

You: :thumbsup:
A:M documentation: :annoyed:
A:M List: :shrug:

I asked some questions about texturing, maybe while you were away. This was right before the Gilles thing. No one mentioned the UV editor. I've been going around saying A:M doesn't have UV coordinates! I've been banging my head, wishing it did, and I'm not the only one. And it actually does have it! Is everyone on the list ignorant of this? Apparently. No one mentioned it to Arthur either.

walasek
01-22-2003, 06:34 AM
Actually, William brought it to my attention. I never knew it was there before he mentioned it - kinda shot my whole proposal, but thats fine.

I really don't think many know that it exists...

jaymackey
01-22-2003, 06:37 AM
Arthur,

What about A:M models that have more than one UV map covering the same area. This is not allowable in the .obj format, right?

So what I understand is that we can do UV coordinate mapping in AM. No need for UVMapper. And we can export an .obj and texture it. The texture files can be brought into A:M and applied to the model. No problems with having to bring the .obj model itself back in and turn it back into proper splines.

But... If we want to have an A:M model with multiple maps, then which set of UV coordinates is going to be exported? Is it possible to pick? The workaround I see is mapping the A:M model completely, with texture maps and displacement maps, for example. Then copying the model a couple of times and deleting maps on each copy so that each one has a unique set. Then export each copy as .obj and texture in DP or ZB. Then the textures should apply to the original, fully mapped A:M model.

walasek
01-22-2003, 07:21 AM
Originally posted by jaymackey
What about A:M models that have more than one UV map covering the same area. This is not allowable in the .obj format, right?
correct

So what I understand is that we can do UV coordinate mapping in AM. No need for UVMapper. And we can export an .obj and texture it. The texture files can be brought into A:M and applied to the model. No problems with having to bring the .obj model itself back in and turn it back into proper splines.
No point in exporting a .obj file. You have the uv mapped coords, and a blank texture. Sounds like most people just put that texture into a paint program like Photoshop, and paint away...

But... If we want to have an A:M model with multiple maps, then which set of UV coordinates is going to be exported? Is it possible to pick? The workaround I see is mapping the A:M model completely, with texture maps and displacement maps, for example. Then copying the model a couple of times and deleting maps on each copy so that each one has a unique set. Then export each copy as .obj and texture in DP or ZB. Then the textures should apply to the original, fully mapped A:M model.
Yes, you can only have 1 set of UV coordinate per face. So either you pick the priority of the maps to select which uv map to use, or you do multiple .obj exports.

But, I really don't see how this helps a whole lot. The only thing it would help with is getting the uv coords out of AM (you can already get the maps out). And this would only be useful if you were going to do something with this model in another app. Also, the texture would look a little different if the model was rendered as polygons, instead of smooth splines. So the maps may have to be corrected if the model were imported to another app that didn't use splines.

Hope that made sense, but it sounds like you have a grasp of the problem...

I'm curious is there is another format (not .OBJ) that supports different uv maps for the different maps that can be applied to a face? .lwo? .3ds?

.ava and .ply do :) hehe

jaymackey
01-22-2003, 08:41 AM
I also re-read William's tutorial, and I noticed that he says that you can rearrange the 'stack' of textures. I'm wondering that if I used your .obj exporter if it would always use the 'top' one. This would be a little faster than making copies of models.

Most A:M people probably are using photoshop or PSP, but if they knew how easy it is to texture in ZBrush, they'd want to use it. I was texturing a peach slice today. It is so easy and actually fun to texture models in ZB. I found a free picture of a peach on a peach distributor's website and used that for the peach skin, and then hand painted the inner flesh of the peach. It was fast. The peach slice would not be that hard to do in PS, but I just would not do more complex things in photoshop.

The distortions inherent in the photoshop workflow are not going to be any better than the distortions of working in ZB on a poly version of an A:M model. ZBrush has poly sub-division, so even a low-patch/polygon model is usually going to look pretty similar to what you would have in A:M. Think about a face like the one in William's tutorial. Look at the UV map, and how you need to pull the chin down, open the mouth and nostrils up, etc. so that you get rid of overlap. Now you can't just paste a picture of a face on the texture in PS, because of the distortion in the map. There are tools, I believe, for distorting a picture to fit the UV coord texture map, whether you use these, or you hand paint it, you still are doing a bit of guessing about where the laugh lines should go exactly, or where the highlights need to go, etc. The workflow is paint some in PS, then test-render in A:M to check your work, then repeat.

Thanks for listening,

zandoria
01-22-2003, 12:42 PM
In the old versions of A:M, export to a format like .3ds allowed you to bake all of your textures together and created composite maps for your exported file. I haven't experimented with this myself, just remembering the old manual (sigh).

I'm not planning a painting tutorial, but if you are trying to figure out how to distort a photograph to match your unwrapped wire frame: Use the "liquify image" command in Photoshop 6 and up.

It creates a fine grid over the image and lets you warp it, pushing, pulling areas with a brush tool and then applying it to the original image when you are done.

dfaris
01-23-2003, 12:12 AM
Ok I would like to see if all this about AM's UV maps really works.
Could sombody take a model say a head and apply the AM UV's to it then export the model to say ZB or deep paint paint a map on the model then use the maps on the model in AM and have it work. Could you try it and if it works could you post what you did and how you got the texture to map to the AM model?

Thanks Dave

walasek
01-23-2003, 02:20 AM
I have done it, but not with AM's uv coordinates.

1) I take an AM model, and export it as .obj (using my plugin)
2) I run UVMapper (a free utility) to generate the uvmap (since my plugin does not currently support exporting uv maps)
3) I Import this new .OBJ file into DeepPaint (I have a free trial of it)
4) I paint away
5) I save only the maps, I do not save the .obj file (because DeepPaint triangulates the mesh and that really will screw up the model in AM)
6) I import it all into a new project using my .obj plugin (it does read uv coords and maps)

Works really well. Only real problems are where there are edges. DeepPaint doesn't have splines, so it kinda smears the paint on the edges. Maybe ZBrush with subdivision would do a better job (but I don't have ZBrush).


One of my ideas was to instead of having to reimport the whole model again in step (6), was to just read the uv coords and maps and apply that to the current model (basically keeping the splines intact). I may still do this...

dfaris
01-23-2003, 02:28 AM
Hey that sounds good about your UV idea.

Question about the AM UV thing how did you get the maps onto the AM model? does it just apply them auto like or do you have to stamp them?

Dave

walasek
01-23-2003, 06:23 AM
The importer will import everything including uv coordinates and maps. It is all automatic with the importer.

walasek
01-29-2003, 02:53 AM
Well, Steve has agreed to host my OBJ plugin up at the hash site. It is only for v10 and it doesn't require the key. You can get it at:
ftp://ftp.hash.com/pub/plugins/ImportExport/windows/

and don't think that we left you Mac folks out... (thx Ken Baer at Hash for porting it over)
ftp://ftp.hash.com/pub/plugins/ImportExport/PowerMac/


Enjoy

JTalbotski
01-29-2003, 03:10 AM
Originally posted by walasek

and don't think that we left you Mac folks out... (thx Ken Baer at Hash for porting it over)
ftp://ftp.hash.com/pub/plugins/ImportExport/PowerMac/


Enjoy

Thanks walasek and Ken! Now I've just got to upgrade.

PJC
01-29-2003, 04:36 AM
Arthur,

Do you have a FAQ on your importer/exporter?

What all does it handle as far as geometry, textures, surface attributes?

I am interested in bringing in models that from turbosquid etc. since there isn't a big repository of AM models for a ton of things.

The Prop importer doesn't work too well, and I'm wondering if this might be a better way to go.

Thanks,

- pjc

JoeW
01-30-2003, 11:02 PM
Originally posted by dfaris
Ok I would like to see if all this about AM's UV maps really works.
Could sombody take a model say a head and apply the AM UV's to it then export the model to say ZB or deep paint paint a map on the model then use the maps on the model in AM and have it work. Could you try it and if it works could you post what you did and how you got the texture to map to the AM model?

Thanks Dave

This actually DOES work, but you need to have an obj exporter that also creates an MTL file (Material). The workflow goes something like this:

1) Build and texture your model and export it as an OBJ with an MTL file.

2) Import this model into Deep Paint - you will most likely have to correct the paths to the maps you've created. If you want to do your painting in Deep Paint (i.e. create your maps), you STILL need to create maps and apply them in AM. The key is this: You are using Deep Paint to MODIFY your existing maps. The OBJ file you export for use in Deep Paint is only serving as a *placeholder* - you don't give a poo about it. You modify your maps in Deep Paint, and when you are done, save them out of Deep Paint over the old maps (it's a damn good idea to make backups of the unaltered maps).

3) When you open your AM model back up, it will reference your MODIFIED maps, and seams that you painted out, etc, will be fixed.

As a note, it's a very good idea to paint all your maps into the same map - i.e. one big image that includes all your maps. This makes sure you don't have problems with different resolutions at seams, etc. This isn't possible all the time, but it can be very helpful.

I this technique works because it's a technique we use here at Avalanche. The downside of Deep Paint is that things like 5-point patches and hooks play hell with it (BUT you can make a version of your model that doesn't have any hooks or 5-pointers, then export it and use it's mesh as placeholder just to modify the maps).

Also, I think DP is one of the worst programs I've ever seen in regards to interface and speed. They've got no competition, so they don't feel any need to update the program. If someone came up with a better paradigm and had good OpenGL support, I'd be ALL over that.... :)

Also, someone mentioned a problem with "stretching" when unfolding models for texturing - the *easiest* way to avoid this is to keep the distances between the CPs as close as possible to what they are when the model is in it's natural state. This can be tough, but it's critical to keeping the maps clear. I find that the easiest way to do this is to use the rotate tool to move points into the same plane - it's cumbersome, but I don't get as much stretching....

JoeW

CGTalk Moderation
01-14-2006, 05:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.