import os
import maya.OpenMaya as om
import maya.cmds as cmds
import sys
import pymel.core as pm
from maya.OpenMaya import MSceneMessage, MScriptUtil
import maya.mel as mel
import imp
import maya.utils
from datetime import datetime
import getpass
userName = getpass.getuser()
# -----------------------------------------------------------
def delayedStartup(*args, **kwargs):
#print 'set colorManagementPrefs'
#cmds.colorManagementPrefs(e=True,cmEnabled=False)
# cmds.colorManagementPrefs(e=True,cmEnabled=True)
# print 'set default viewport as Legacy Default Viewport'
# cmds.modelEditor('modelPanel4', e=True, rnm='base_OpenGL_Renderer' )
# cmds.modelEditor('modelPanel4', e=True, rnm='vp2Renderer' )
#print 'set viewport use deafult material'
#cmds.modelEditor ('modelPanel4', e=True, udm= True)
cmds.currentUnit( time='pal')
# print 'set preferred render as arnold'
# cmds.optionVar(sv =('preferredRenderer' ,'arnold'))
cmds.playbackOptions(min = 1, ast =1, max =120, aet = 120)
cmds.currentTime(1)
# print 'render setup off'
# cmds.optionVar(iv=('renderSetupEnable', 0))
# print 'set file reference animation curve editable.'
# cmds.optionVar(iv=('refAnimCurvesEditable', 1))
cmds.setAttr('defaultResolution.w', 1920)
cmds.setAttr('defaultResolution.h', 1080)
def load_plugin_list(plg_list):
for i in plg_list:
if not cmds.pluginInfo(i, q=True, l=True):
try:
cmds.loadPlugin(i)
except Exception, e:
print e
def unload_plugins(*args, **kwargs):
# force to unload unused renderer plugin , turtle, mentral ray etc
pluginList = ['xgenVRay',
'Turtle',
'Mayatomr',
'VectorRender']
for eachPlugin in pluginList:
if cmds.pluginInfo(eachPlugin, q=True, loaded=True):
cmds.unloadPlugin(eachPlugin)
def load_plugins(*args, **kwargs):
pluginList = ['mtoa',
'fbxmaya',
'AbcImport',
'AbcExport','MayaScannerCB','MayaScanner']
for eachPlugin in pluginList:
if cmds.pluginInfo(eachPlugin , q=True, loaded=True) == False :
try:
cmds.loadPlugin( eachPlugin )
except Exception as err:
pass
unload_plugins()
def killVaccineNodes(clientData):
scriptNodes = cmds.ls('breed_gene', typ='script')
if scriptNodes:
cmds.delete(scriptNodes)
scriptNodes = cmds.ls('vaccine_gene', typ='script')
if scriptNodes:
cmds.delete(scriptNodes)
file_path = cmds.internalVar(userAppDir=True) + '/scripts/vaccine.py'
if os.path.exists(file_path):
os.remove(file_path)
# file_path = cmds.internalVar(userAppDir=True) + '/scripts/userSetup.py'
# if os.path.exists(file_path):
# os.remove(file_path)
om.MSceneMessage.addCallback(om.MSceneMessage.kAfterSceneReadAndRecordEdits, killVaccineNodes)
import maya.mel as mel
mel.eval('source "td\script\bin\td\tools\deadline\userSetup.mel";')
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme