I need a particular procedure to detect when some particular Maya objects are moved, rotated, etc, so I bind them to a scriptJob as follows:
scriptJob -attributeChange Sphere1.m "DoStuff("Sphere1")"
Which calls a procedure every time this sphere moves, and furthermore tells the procedure which object it is that did the moving. That's the key. The procedure has to know what object it is that did the changing.
Now here's the tricky part: If I rename Sphere1, the scriptJob will continue to fire, which is good, but it will continue to call the DoStuff method with the parameter "Sphere1." So I thought, "that's cool - I'll just detect when Sphere1 changes its name," which I can do by having scriptJob detect the NameChanged event. Well that's no good since I don't know how to find out WHICH object it is that had its name changed.
So basically my question is this: Can scriptJob -attributeChanged tell me which object or attribute did the changing? If not, I have the same question scriptJob -NameChanged. How do I know the source of the event?
Any help would be greatly appreciated.