[PyMel] 3ds Max callbacks-like functionality in Maya

I’m trying to find something in Maya that’s analogous to the callbacks interface in Maxscript. Does anyone know where to look, or a potentially better way to do this? I’d be happy enough if I had to write something that monitors what’s echoed to the command history, but I haven’t been able to find anything like that.

can you post an example of what a Maxscript callback looks like?

I have no idea what you’re trying to do, but the obvious place to start looking is in the scriptjob command.

http://download.autodesk.com/us/maya/2010help/CommandsPython/scriptJob.html
http://download.autodesk.com/us/maya/2010help/Commands/scriptJob.html <-- MEL version.

@rgkovach123: if I wanted to do something when I file opens in 3ds Max I’d do this:


callbacks.addscript #filePostOpen "doThing()"

@btribble: scriptJobs seem to be the way to go. Thanks for pointing me in the right direction.

yeah, scriptjobs are what you’ll need. also look at scriptNodes, which stores snippets of code onto a node into the file. The code is run when the file is opened.