Sam Cuttriss wrote:
incase anyone cares, im sure this is flawed but, it worked:
aEnd0 = map(lambda x,y: x/(y+0.00001), aSrc[0], aSrc[2])
Sam, I'm not sure why your original was giving you the error you were
getting but here's another approach which uses list comprehensions..
uvArray = Application.Selection(0).Elements.Array
l = zip(*[(x[0]/x[2],x[1]/x[2],x[2]) for x in zip(*uvArray)])
LogMessage(l)
It's not particularly readable so here it is expanded (with a map
alternative commented out):
#select your texture definition
uvArray = Application.Selection(0).Elements.Array
#either a single listcomprehension which uses zip to pack the u,v and w
#into individual tuples
l = [(x[0]/x[2],x[1]/x[2],x[2]) for x in zip(*uvArray)]
#or use map in the same way
#l = map(lambda x: (x[0]/x[2],x[1]/x[2],x[2]), zip(*uvArray))
#then unpack the tuples back into a conventional Element Array style list..
l = zip(*l)
LogMessage(l)
Julian
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi