Build a generator of scale/object tuples, and take the max
of that. By putting the scale first, max
keys off that correctly.
locators = ((getAttr(locator+'.localScaleY'), locator) for locator in pm.ls('locator*'))
yMaxValue, locator = max(locators)
A few outputs for reference:
>>> list(locators)
# Result: [(1.0, nt.Transform(u'locator01')),
(2.0, nt.Transform(u'locator02')),
(3.0, nt.Transform(u'locator03')),
(1.0, nt.Locator(u'locator0Shape1')),
(2.0, nt.Locator(u'locator0Shape2')),
(3.0, nt.Locator(u'locator0Shape3'))] #
>>> yMaxValue
# Result: 3.0 #
>>> locator
# Result: nt.Locator(u'locator0Shape3') #