Adverti horiz upsell

Callback Utilities 1.0.0 for Maya (maya script)

This class is to help build a Maya callback foundation. The user should be able to expand on this callback class. I've focused on the Maya scene update callbacks which are very useful for auto update Maya UIs.

License
Button download
170 Downloads

Compatibility

  • 2014, 2013, 2012, 2011, 2010

Operating Systems

  • Windows

History

Created:07/08/2013
Last Modified:07/08/2013
File Size: 3.73 KB
This class is to help build a Maya callback foundation. The user should be able to expand on this callback class. I've focused on the Maya scene update callbacks which are very useful for auto update Maya UIs.

'''
----> Examples <----
Prints out all nodes in the scene before the new scene opend then prints out all nodes in the new scene.
'''
import maya.cmds as cmds
import callback_util

# Example proc
def print_all_nodes(*args):
   print cmds.ls('*')
   print len(cmds.ls('*'))

# Create callback instance
callback_obj = callback_util.Callback((print_all_nodes))

# Run proc before scene updates
callback_obj.scene_update_before()

# Run proc after scene updates
callback_obj.scene_update_after()

# Adds more maya node
for i in range(20):
   cmds.spaceLocator()

# Open new Maya scene
cmds.file (f=True, new=True)

# Removes callback from instance
callback_obj.remove()


-Nick
___________________
Nicholas Silveira
Technical Artist
Email: nicholas.silveira@gmail.com
nicholas-silveira.blogspot.com
linkedin.com/in/nicholassilveira

Please use the Bug System to report any bugs.
Please use the Feature Requests to give me ideas.
Please use the Support Forum if you have any questions or problems.
Please rate and review in the Review section.

People who favorited this item:

  • 鹏
  • xtvjxk
    xtvjxk