Transferring UVs AFTER rigging....

This is a tough one, but here's the HACK. Lets say you've rigged up your amazing character and realize OH, I have to make a bunch of UV changes. You copy out your character's head, UV it up nicely, bring it back in and use the "transfer attributes" from your copied head to the rigged one.
No deal. It's because your transfer attributes input comes after rigging and all UV inputs have to come before rigging. Same as in Ncloth.
I don't understand why Autodesk doesn't put in a "before deformers" option or something similar to how you can insert blendshapes at certain parts of a deformer chain.
ANYWAY
Every object has a "shape orig" node which represents what an object was before it was deformed. We can apply a UV transfer to this no problem which will also transfer up the stack to your rigged object.
I access it like this

1. Select your rigged object, in the hypergraph hit options/display/ hidden nodes & shape nodes
2. You'll see a hidden node which is your Orig node, or what your object was before rigging.
3. In the orig node's attribute editor under object display, uncheck 'intermediate object'
4. Your Orig node is now accessible.
5. Apply your UV transfer attributes to it - then delete it's history.

There you go - you've applied your transfer to your object via it's history object. Maya sees it that you performed this operation before rigging. Now why Autodesk hasn't made a tool for this....who knows.

Comments

Hafizah said…
THANK YOU! You saved me from countless more hours of frustration. Your post was the only one I found (so far, anyway) that gave a solid solution. Thanks! =)
Daniel Harris said…
Found this very useful. Thanks for sharing!!

-Dan
BC said…
I get a crash and a cycle warning whenever I try this. I'd love some help :(
Unknown said…
Man....you are a true genius and saved my day! Thank you again!
Antony Thomas said…
import pymel.core as pm


def doTransfer(source, *args, **kwargs):
"""
Transfers attrs pre skin cluster.
:param source: Mesh to copy from.

:param args: Mesh(s) to paste (with skin cluster).

:param kwargs: uv: bool - transfer uvs.
normals | n: bool - transfer normals.
vertex | v: bool - transfer vertex positions.
:return: None
"""
uv = kwargs.pop('uv', 0)
normals = kwargs.pop('normals', kwargs.pop('n', 0))
vertex = kwargs.pop('vertex', kwargs.pop('v', 0))

if kwargs:
raise ValueError('--Unknown argument(s): {}'.format(kwargs))

if not args:
raise ValueError('--Specify a target mesh.')

for target in args:
target_shapes = target.getShapes()

orig = None
for shape in target_shapes:
if shape.intermediateObject.get():
orig = shape
break

if orig is None:
raise TypeError('--Target mesh: {} has no origin shape.'.format(target))

print orig
orig.intermediateObject.set(0)

pm.transferAttributes(source,
orig,
transferUVs=uv,
transferNormals=normals,
transferPositions=vertex)

pm.delete(orig, constructionHistory=True)
orig.intermediateObject.set(1)


sel = pm.selected()
source = sel.pop(0)
doTransfer(source, *sel, uv=True)
Olivier Ladeuix said…
Woww, thanks Anthony Thomas for the script! I wasn't able to follow the steps described but your script made the entire process so smooth once I formatted the indentation correctly. Cheers buddy!
Olivier Ladeuix said…
yeah the technique is still relevant 12 years later ;-)

Popular posts from this blog

Maya A/B transform match script