I’ve got an annoying bug caused by the existence of two non-physical nodes (dagPoses, to be exact) with the same name but different namespaces. Pymel wants to resolve these to their short (non-namespaced) names when they are used in a callback, so any references to them crash with 'there are two objects named XXXX '. However, since they are PyNodes but not DagNodes, there is no fullpath() method on them to get the disambiguated name.
What’s a boy to do?
fmt = lambda n : n.name().split(":")[-1]
poses = pm.ls(type='dagPose', l=True)
poses.sort()
poses = [p for p in poses if not "bindPose" in p.name()]
for n, eachpose in enumerate(poses):
labeltext = fmt(eachpose)
btn_color = self.COLORS.get(labeltext[:2], (.5,.5, .65))
yield 'pose_%s' % n,
pm.button( labeltext, w=120, h= 32, bgc = btn_color,
c= partial(self.apply, eachpose)) #<== 'boom' for nodes with namespaced twins