def main(*args): cmds.about(windows=1) script = os.path.realpath(__file__) scripts_dir = os.path.dirname(script) scriptsPath = scripts_dir.replace("LGT", "ScriptPackages") scriptsPath = scriptsPath.replace('\\', r'/') CreateRsID_AOVPath = scriptsPath + r'/LGT/CreateRsID_AOV' pm.python("execfile(r" + "\"" + str(scriptsPath) + "/LGT/CreateRsID_AOV/CreateRsID_AOV.py" + "\"" + ")") if cmds.about(windows=1): CreateRsID_AOV = CreateRsID_AOVPath.replace(r'/', '\\') else: pass if CreateRsID_AOV not in sys.path: sys.path.insert(0, CreateRsID_AOV) try: import CreateRsID_AOV except: cmds.error( 'the CreateRsID_AOV folder is placed wrong,the right path is : {0}' .format(scriptsPath)) reload(CreateRsID_AOV)
def main(*args): cmds.about(windows=1) script = os.path.realpath(__file__) scripts_dir = os.path.dirname(script) scriptsPath = scripts_dir.replace("Other", "ScriptPackages").replace('\\', r'/') ManagerPath = scriptsPath + r'/Other/AssetScript' mel.eval('source "{}/scripts/open_load_maya_file_about.mel";'.format( ManagerPath)) mel.eval('source "{}/scripts/openDir.mel";'.format(ManagerPath)) pm.python("execfile(r" + "\"" + str(ManagerPath) + "/asset_GuanLi.py" + "\"" + ")") if cmds.about(windows=1): AssetScript = ManagerPath.replace(r'/', '\\') else: pass if AssetScript not in sys.path: sys.path.insert(0, AssetScript) try: import asset_GuanLi except: cmds.error( 'the DW_MaterialManager folder is placed wrong,the right path is : {0}' .format(ManagerPath)) reload(asset_GuanLi) asset_GuanLi.CGStorm_Asset_Manage_UI()
def main(*args): script = os.path.realpath(__file__) scripts_dir = os.path.dirname(script) cmds.about(windows=1) scriptsPath = scripts_dir.replace("Other", "ScriptPackages") onModelChange3dcPath = scriptsPath + r'/Other/onModelChange3dc' pm.python("execfile(r" + "\"" + str(scriptsPath) + "/Other/onModelChange3dc/onModelChange3dc.py" + "\"" + ")") if cmds.about(windows=1): onModelChange3dc = onModelChange3dcPath.replace(r'/', '\\') else: pass if onModelChange3dc not in sys.path: sys.path.insert(0, onModelChange3dc) try: import onModelChange3dc except: cmds.error( 'the onModelChange3dc folder is placed wrong,the right path is : {0}' .format(scriptsPath)) reload(onModelChange3dc) onModelChange3dc.onModelChange3dc()
def main(*args): cmds.about(windows=1) script = os.path.realpath(__file__) scripts_dir = os.path.dirname(script) scriptsPath = scripts_dir.replace("Mod", "ScriptPackages") scriptsPath = scriptsPath.replace('\\', r'/') NitroPolyPath = scriptsPath + r'/Mod/NitroPoly' pm.python("execfile(r" + "\"" + str(scriptsPath) + "/Mod/NitroPoly/NitroPoly.py" + "\"" + ")") if cmds.about(windows=1): NitroPoly = NitroPolyPath.replace(r'/', '\\') else: pass if NitroPoly not in sys.path: sys.path.insert(0, NitroPoly) try: import NitroPoly except: cmds.error('the NitroPoly folder is placed wrong,the right path is : {0}'.format(scriptsPath)) reload(NitroPoly) NitroPoly.main()
def main(*args): script = os.path.realpath(__file__) scripts_dir = os.path.dirname(script) cmds.about(windows=1) scriptsPath = scripts_dir.replace("Mod", "ScriptPackages") WindCyclePath = scriptsPath + r'/Mod/GeometryCache_WindCycle' pm.python("execfile(r" + "\"" + str(scriptsPath) + "/Mod/GeometryCache_WindCycle/GeometryCache_WindCycle.py" + "\"" + ")") if cmds.about(windows=1): WindCycle = WindCyclePath.replace(r'/', '\\') else: pass if WindCycle not in sys.path: sys.path.insert(0, WindCycle) try: import GeometryCache_WindCycle except: cmds.error( 'the GeometryCache_WindCycle folder is placed wrong,the right path is : {0}' .format(scriptsPath)) reload(GeometryCache_WindCycle) GeometryCache_WindCycle.GeometryCache_WindCycle()
def createLight(lightType, position=None, rotation=None): """ Create and Position Lights """ if str(lightType).startswith("VRay"): light = pm.shadingNode(lightType, asLight=True) elif lightType == "AreaLight": pm.python("pm.nodetypes.%s()" % lightType) light = pm.PyNode(getSelection()) pm.connectAttr("%s.instObjGroups" % light.getParent().name(), "%s.dagSetMembers" % "defaultLightSet", na=True) elif lightType == "VolumeLight": # TODO: Pymel VolumeLight pm.mel.eval("defaultVolumeLight(1, 1,1,1, 0, 0, 0,0,0, 1);") light = pm.PyNode(getSelection()) # TODO: ? PyNode else: pm.python("pm.%s()" % lightType) light = pm.PyNode(getSelection()) # TODO : checks for position and rotation try: light.setTranslation(position) light.setRotation(rotation) except AttributeError: light.getParent().setTranslation(position) light.getParent().setRotation(rotation)
def main(*args): script = os.path.realpath(__file__) scripts_dir = os.path.dirname(script) cmds.about(windows=1) scriptsPath = scripts_dir.replace("Mod", "ScriptPackages") autoPlacePivotPath = scriptsPath + r'/Mod/MayaClarisseBridge' pm.python("execfile(r" + "\"" + str(scriptsPath) + "/Mod/MayaClarisseBridge/MayaClarisseBridge.py" + "\"" + ")") if cmds.about(windows=1): autoPlacePivot = autoPlacePivotPath.replace(r'/', '\\') else: pass if autoPlacePivot not in sys.path: sys.path.insert(0, autoPlacePivot) try: import MayaClarisseBridge except: cmds.error( 'the autoPlacePivot folder is placed wrong,the right path is : {0}' .format(scriptsPath))
import pymel.core as pm script = ['import pymel.core as pm', 'if pm.objExists("bristle_pad_FOLLICLE"):', '\tif not pm.PyNode("propCleanserBrush_bristles_GRP").translateX.isConnected():', '\t\tpm.parentConstraint("bristle_pad_CONNECT", "propCleanserBrush_bristles_GRP")' ] pm.python('\n'.join(script)) pm.scriptNode(bs="\n".join(script), stp='python', st=7, n='bristleAttach_SCRIPTNODE') ''' #execute the scriptnode code: import pymel.core as pm pm.scriptNode('bristleAttach_SCRIPTNODE',eb=True) '''