Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import maya.mel as mel
  2. import maya.cmds as cmds
  3.  
  4. """This function check if MR is loaded and load MR if it is not"""
  5. #List all plugins
  6. QueryMR = cmds.pluginInfo( query=True, listPlugins=True )
  7.    
  8. #We supposed that Mental Ray is not loaded
  9. x=False
  10.    
  11. #Check if one of the plugin is Mayatomr
  12. for i in QueryMR:
  13.     if i == "MayaMuscle":
  14.         x = True
  15.    
  16. #if the test above have not MR,load the plugin        
  17. if x == False:
  18.     try:
  19.         cmds.loadPlugin('MayaMuscle',quiet=True)
  20.     except:
  21.         print("MayaMuscle may be already loaded")
  22. else:
  23.     print("MayaMuscle may be already loaded")
  24.  
  25.  
  26. mel.eval('cMuscleSurfAttachSetup();')