Skip to content

Instantly share code, notes, and snippets.

@BigRoy
Created August 14, 2015 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BigRoy/d7848602d86e4f254582 to your computer and use it in GitHub Desktop.
Save BigRoy/d7848602d86e4f254582 to your computer and use it in GitHub Desktop.
import maya.OpenMaya as om
import maya.cmds as mc
def callback(node, clientData):
fnDep = om.MFnDependencyNode(node)
node_name = fnDep.name()
print node_name
if __name__ == '__main__':
# Delete previous run (testing only)
if 'id' in globals():
try:
om.MMessage.removeCallback(id)
except RuntimeError, e:
print e
id = om.MDGMessage.addNodeAddedCallback(callback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment