PDA

View Full Version : How can you check if 2 geo have same UV?


zhenpanda
05-10-2011, 12:03 AM
Is there a way for maya to check if two geo is sharing the same UV?

r4inm4ker
05-10-2011, 02:13 AM
don't think so. You might check whether the uv counts are identical (by using polyEvaluate command, for example).

cdmcg
05-11-2011, 09:32 PM
After tinkering with a sphere I found this command

cmds.polyEditUV('pSphere1.map[197]', query=True, uValue=1)


and when ran I get this output:

# Result: [0.40000003576278687, 0.50000005960464478] #


So maybe you can write something to compare to lists of UV's, I dont know, thats what I figured out so far, I will keep playing with it.

EDIT:

Ok, well, this is not the prettiest but it works so far.

#Select first sphere and get its UV's
cmds.select('pSphere1.map
')
test1 = cmds.ls(sl=1)
cmds.select(clear=True)
#loop through UV's and get location
for tst1 in test1:
tstUV1 = cmds.polyEditUV(tst1, query=True)
#Select second sphere and get its UV's
cmds.select('pSphere2.map
')
test2 = cmds.ls(sl=1)
cmds.select(clear=True)
#loop through UV's and get location
for tst2 in test2:
tstUV2 = cmds.polyEditUV(tst2, query=True)
#Select cube and get its UV's
cmds.select('pCube1.map
')
test3 = cmds.ls(sl=1)
cmds.select(clear=True)
#loop through UV's and get location
for tst3 in test3:
tstUV3 = cmds.polyEditUV(tst3, query=True)
#Compare sphere 1 and sphere 2 UV's
if tstUV1 == tstUV2:
print('These match')
else:
print('these are not a match')
#Compare sphere 1 and cube UV's
if tstUV1 == tstUV3:
print('These match')
else:
print('these are not a match')
#Compare sphere 2 and cube UV's
if tstUV1 == tstUV3:
print('These match')
else:
print('these are not a match')

it works, there is pry a cleaner way to do this. But this is what I have came up with so far.

CGTalk Moderation
05-11-2011, 09:32 PM
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.