PDA

View Full Version : how to unwrap_uvw save and load by script .


hblan
02-17-2006, 06:18 AM
add a unwrap_uvw to a object . setMapChannel to 3 , and then use "edit" button to modify the uv,
at this time , if u setMapchannel to 1 , and now use flatten button to flatten , the uv that u modified will all be losted .
generally if we want in the new channel we can use the last flatten uv , we have to save the uv at mapchannel 3 and after change to mapchannel 1 we can load the uv file .
my question :

save and load the uv has only this command:
<void>save()

Presses the Save button in the modifier抯 UI

<void>load()

Presses the Load button in the modifier抯 UI

all these command will open the standard dialog ,but i want it save and load automaticly with the script , maybe function like this :

<void> save <object`s unwrap_uvw modifier> <fileName>
<unwrap_uvw modifier> load <fileName> --this command return the saved .uvw file .

i have large objs for save at channel 3 and back to channel 1 . so have to search here for help .


thanks for help .

prettyPixel
02-17-2006, 09:54 AM
Effectively if you change the channel of a modifier unwrap_uvw the changes are lost.
The principle is always to have 1 modifier unwrap by channel used.
If you change the channel the modifications are lost because it is a modifier and this changes are not saved in the mesh structure. And no copy is realized during the change.

If you wish to use the channel 3 as start point for another channel (example the 1), you could copy it directly rather than use a save/load. It seems to me easier and especially faster.



3dsmax have already an interface dedicated to the copy of the UV: Tools / Channel Info
Personally I avoid using it because in case of strong use the software become unstable.

If the method of copy interests you, I wrote a script which do it:

http://users.skynet.be/arketip/arketip_copyMapChannelENG.htm

You will find inside 2 different functions to copy UVs:

fn copyMapChannel
fn copyMapChannel2

The second routine uses the channelInfo interface.
The first one uses another method but it is slower (if your objects have many faces)


Hope this helps

hblan
02-19-2006, 08:20 AM
i will check the script . thanks .prettypixel.

CGTalk Moderation
02-19-2006, 08:20 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.