import maya.mel as mel
import maya.cmds as cmds
"""This function check if MR is loaded and load MR if it is not"""
#List all plugins
QueryMR = cmds.pluginInfo( query=True, listPlugins=True )
#We supposed that Mental Ray is not loaded
x=False
#Check if one of the plugin is Mayatomr
for i in QueryMR:
if i == "MayaMuscle":
x = True
#if the test above have not MR,load the plugin
if x == False:
try:
cmds.loadPlugin('MayaMuscle',quiet=True)
except:
print("MayaMuscle may be already loaded")
else:
print("MayaMuscle may be already loaded")
mel.eval('cMuscleSurfAttachSetup();')