Special UV Transfer Script v1.0

Simple script that saves a lot of time and frustration.

Download the SpecialTransferUV_v1.0 MEL Script!

So in much of my frustration when working recently on laying out UVs after rigging a few models I’ve been working on in my thesis, I discovered that Maya’s Transfer Attributes function for getting UVs from one model to another model that’s rigged does not quite work right.  What appears to happen is that there is a linked attribute between the model and the rest that seems to be just fine at first, however, if you want to move your transfered UVs around in the UV editor, it’s not permanent.  Especially if you decide to delete the original model from your scene which is even worse as it reverts the changes you made back to the model’s originally UV positions.

Two objects with different UV Layouts. Both have deformers applied.

UV Layouts for both Sphere_2 is in the upper left and Sphere_1 is in the lower right.

Typically you use these settings to transfer UVs from one object to another, but in this case, a skinned rig will not work as well.

Transfer Attributes happened, but notice the new “transferAttributes1″ Input on the Sphere_2 object.

Now UVs overlap, but what happens when the original sphere is deleted?

Notice when I deleted Sphere_1 on the left, Sphere_2 on the right reverts back to the original UV layout it had. Also notice the Input transferAttributes1 connection still exists.

This frustration is due to the fact that Maya creates a shape node that is a duplicate of another node that hides once it has a skin or deformer bound to the object.  When this happens, the duplicate node receives all the new attributes.  So when you apply UV settings to the object, it’ll be to the current shape node on the object while the original shape node retains the original UV information.  When you transfer the UVs to a similar object in the scene, the transfer information is linked and while you could Delete History on the object to bake in the settings, it’ll ruin and delete your rig.  Even deleting non-deformer history on the object will not work either.

So the solution is to find the original shape node on the deformer/skin bounded object and apply the transfer UV information to that, delete the history on the node and then return it to being the original node and then it’ll appropriately affect the rig’s UV layout.  I created a script to help with this process and made it possible to apply UV mapping to single and multiple objects.  Below details the quick steps to follow in running the script.

Run the Script and follow the instructions. Basically select both objects and the LAST selected will be the object of which the UV layout will originate from.

After selecting and clicking the one button, the UVs apply to the object properly. Notice the lack of the Input transferAttributes1 to the sphere now.

Now that the UVs are permanently bound, you can delete the object of which you transferred the UVs from and NOW the sphere will still retain the UV layout!

As promised, there is a way for you to easily select multiple objects and apply the UVs to those in all one-fell-swoop!  And guess what?  It’s the same procedure!

Select the objects you want to apply the UV layout to. Remember that the last object is the reference that’ll be used for the UV layout for the rest of the objects.

And after pressing that magic button, UVs applied! Again, notice the transfer attributes input is not there.

Now all objects retain the UV Layout even when the previous no longer exists!

Mind you, just in case, always version up your saved scenes before running through magical scripts.  Through my needs and testing, this works.  Any questions or comments are welcome.  Hopefully this finds some use in other hands!

6 Comments

  • vijay says:

    This is great. I have faced this exact problem before. But because my models were not as heavy as yours, I ended up grouping all the original objects and then hiding that grp.. Out of sight.. out of mind logic :)
    I will try using your script for the ret of my models and tell you if it worked fine.

  • josh says:

    im on maya 2014, when i try using your script, it deletes the other object(s) after i execute. the originator (last one selected stays, but no uvs are transferred, and the other objects get deleted)

    • SpunkyDDog says:

      Hey Josh – I don’t have Maya 2014 – this was written for 2012. I’ll see what I can do in my spare time to solve this issue you’re having. First thing in my mind is that are the objects you are transferring attributes to, are they actually being deleted or are they transparent? Sometimes Maya does a funky thing where objects look like they disappear, but actually they are still there in your outliner not having been deleted.

  • Arun S says:

    Thanks….good job

  • Nina says:

    Thank you, thank you, thank you very much!

    You saved our uni-project with your script, dude! Oh god, bless this hero :D

Leave a Reply

Your email address will not be published.