Tuesday, December 17, 2013

multi layer patch copy

 There are times, we will be doing texturing for assets on one side and want to copy the same to the other half of the model( at least base layers if not the details).

Wrote this script to easy out the copying task...

First...You define UDIM Mapping:
In udim mapping you specify the source and target patches.
source patch is the patch you want to copy image data from and target patch is the patch you want to copy data to. clear ?

It will be written as follow
eg: 1 : 2    read as udim 1001 will be copied to udim 1002

The advantage with udim mapping is you can specify multiple mappings in one go.
 eg: 1 : 2 / 3 : 4  read as udim 1001 copied to udim 1002 and(/) udim 1003 copied to udim1004

you can also specify multiple target patches
 eg: 1 : 2 , 3 , 4    read as udim 1001 will be copied to udim 1002 and 1003 and 1004
so we have multiple target patches here...

to avoid repetition you can specify range also
eg: 1 : 2 - 4       same as above. read udim 1001 will be copied fo udims 1002,1003,1004
here "-" denotes range

so to illustrate an example... a file with 10s of udim patches with may repetetions will look something like this...

eg, 1 : 2 - 6, 9, 15, 21 / 5 : 11, 12, 13 / 10 : 14

It might be a bit of work to define the udim mapping for the first time. But once done you can use it through out the life of the prop.

So, while closing the file you might want to save your mapping in  a text editor as it was waste of time to re write it every day (Imagine in produciton when you have 100s of udims). Don't worry... One you hit copy. The udim map you defined will be saved to a .txt file in your log directory.  You can hit recover udim mapping and it will get the udim mapping back for you.
fair enough?

Added to that.. It will save the udim mapping for all the objects in the file. Lets say you have 3 objects in the file and you wrote udim mapping for all 3 of them. It will save the udim mapping for all of them with respect to their name and will recover back based on your current object.  This will work fine untill and unless you changed your object name.

Some of the advantages of the script...

1. This copying stuff happens for all the selected layers. So, you can select a bunch of layers and it will copy for only that particulary layers.

2. It will take care of all the mask stacks, or mask on the selected layers.

3. It will take care of all the masks on the adjustment layers in the adjustment stack.

4. It works recursively... so just selecting a group layer will be enough if you want to copy for the whole group.

here is the script...
This one needs more rigorous testing and any feedback on it will be appreciated!

code here... multi layer patch copy

No comments:

Post a Comment