This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Command port | |
| http://forums.cgsociety.org/archive/index.php?t-966699.html | |
| Creative Crash | |
| ''' | |
| import socket | |
| #HOST = '192.168.1.122' # The remote host | |
| HOST = '127.0.0.1' # the local host | |
| PORT = 54321 # The same port as used by the server | |
| ADDR=(HOST,PORT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PySide import QtCore, QtGui | |
| import shiboken | |
| import maya.OpenMayaUI as omui | |
| from maya.app.general.mayaMixin import MayaQWidgetDockableMixin | |
| import pymel.core as pm | |
| def wrapInstance(ptr, base=None): | |
| """ | |
| Utility to convert a pointer to a Qt class instance (PySide/PyQt compatible) | |
| borrowed from http://nathanhorne.com/?p=485 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pymel.core as pm | |
| import re | |
| def parseVtxIdx(idxList): | |
| """convert vertex index list from strings to indexes. | |
| idxList : [u'vtx[1]', u'vtx[3]', u'vtx[6]', u'vtx[8]', u'vtx[12:13]'] | |
| return : [1,3,6,8,12,13] | |
| """ | |
| parseIdxList = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import maya.mel as mel | |
| import maya.OpenMayaUI as omui | |
| from PySide.QtGui import * | |
| from PySide.QtCore import * | |
| from shiboken import wrapInstance as wrap | |
| qMaya = wrap(long(omui.MQtUtil.mainWindow()), QMainWindow) | |
| # find chennelbox | |
| gChannelBoxName = mel.eval('$temp=$gChannelBoxName') | |
| table = qMaya.findChild(QTableView, gChannelBoxName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import maya.OpenMaya as om | |
| import maya.cmds as cmds | |
| def _findFlippedUVs(nodesOnly=True): | |
| ret = [] | |
| selList = om.MSelectionList() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = "Narendra 'aka' NaRango" | |
| ''' | |
| Exports assets directly to selected Unity Project | |
| valid Assets = models | |
| USAGE: | |
| 1) Execute this script in Maya's Script Editor | |
| 2) It should open "Unity Exporter" window |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Author: Greg Torrn | |
| script: changeMayaWindowColor | |
| '''from maya import cmds | |
| import colorsys | |
| import random | |
| h = round(random.uniform(0.0, 1.0), 2) | |
| s = round(random.uniform(0.0, 1.0), 2) | |
| v = round(random.uniform(0.1, 0.5), 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import maya.cmds as cmds | |
| import re | |
| import maya.OpenMaya as om | |
| def getComponentId(component): | |
| """get id number from a component (i.e. pCube.vtx[12]) , and return as int (i.e. 12 ) .""" | |
| tokens = re.split('[\[\]]',str(component)) | |
| try: | |
| return int(tokens[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from maya import cmds | |
| sFile = cmds.file(q=True, sceneName=True) | |
| cmds.file(sFile, open=True, force=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import maya.cmds as cmds | |
| # Close ports if they were already open under another configuration | |
| try: | |
| cmds.commandPort(name=":7001", close=True) | |
| except: | |
| cmds.warning('Could not close port 7001 (maybe it is not opened yet...)') | |
| try: | |
| cmds.commandPort(name=":7002", close=True) | |
| except: |
NewerOlder