Friday, June 15, 2012

transfer UV's follow up . . .

A little while ago Nasheet posted a comment about solving some of the issues people were having with the transferUV script I posted here:

"""
It worked well for most of the meshes in my scene, but I did get the same error as teezy5 for a couple of them, and I think I found a solution. The error was thrown from:

`getAttr ($targetOrig+".intermediateObject")`;

The problem in my case was that there was more than one object named '$targetOrig' in my scene, and thus the return value of the 'getAttr' was an int[] containing the intermediateObject values for all matching objects, instead of just an int. In order to only get the unique intermediateObject for the selected geometry, 'listRelatives' needs to return the full dagpath. Basically, I just changed the line:


string $targetShapes[] = `listRelatives-s $target`;

to

string $targetShapes[] = `listRelatives-s -f $target`;


And it worked. That's it! Thank you again!
"""
Haven't had a chance to play with it, but sounds right to me. . .
Thanks Nasheet!

Here's the fixed script: zbw_cleanTransferUV.mel

2 comments: