View Full Version : [code/WIP] BETA transfer adaptive poly UVs -> subd UVs

05 May 2003, 07:22 AM
It's not pretty. It's not fast. But it's there. Ideally this would turn into a community effort. I'm hoping people can give me pointers on how to make this script better (aside from using the api; don't have vc++) and/or themselves make the script better and post refinements. It has two basic functions, one which is called intially on a subd surface and another to update uv movements. (updateUVs())

Be sure to back up any work your doing because it might crash maya if you try it. I am not responsible for any damage done, thank you very much.

Here's what to do:
1. put the following code in you programfiles/maya/scripts/startup directory. Or whereever you want I guess.

2. Make a new shelf button with the following codelet:

// source script
source test1;

this will call the script when you press it.

3. This step could crash Maya. So back up work and all that.
Take or make a subdivision surface. Press the mel button you made. What its doing is looking through every uv on the subd surface and establishing a relationship with the corresponding poly uvs. It should take under a minute I hope (depends on how dense your model is).

4. When it's done you'll be dropped into a polygonal copy of the subd surface. Grab some uvs and edit them. Remember you can't cut/merge yet; i should be able to do that today (basically regenerate the whole poly all over again).

5. After you edited uvs, select the polygon uvs that you want to update on the subd surface. Then type


It'll run through the subd surface and update. You can check to make sure that they are the same. Remember it only updates the uvs that you selected. If you forget to select some it'll be out of synch. This is esp true with operations like relax, where it affects everything.

If you don't select any uvs it'll (i hope) update all of them. This, again, could take some time.

If anyone wants to edit this script or use or whatever, feel free, just post your modifications. uh okay.

thanks for your time

05 May 2003, 11:58 PM
first off: vote for faster subd/poly performance at:

okay. I included a real simple UI and did the merge/cut fuctions. As far as simple objects, everything works. The problem is working with more complex and larger objects it simply crashes. If you press generate and you're not looking at mesh UVs when your done that probably means its about to crash. Hmm I'm not making this script sound to good. It really would've been better to use the api. But even still, that's a loooot of information to store.

But all is not lost, it can be used for small subd objects that you plan to attach together.

The instructions above are still valid, but change the shelf button to:

// source script
source polyUVstoSubduvs;

1. You generate a mesh from the subd surface.

2.Yyou can move points around and update the movement by pressing Update UV locations

3. If you want cut/merge an area select the edges and press the appropriate Cut/Merge button.

4. If you suspect something is out of synch, than press the (re) generate button.


CGTalk Moderation
01 January 2006, 08: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.