Skip to content

Instantly share code, notes, and snippets.

import maya.cmds as cmds
selection = cmds.ls(sl=1)
for item in selection:
cmds.select(cl = True)
for face in [2,5,8,6,19,39,12,23]:#Aqui entre corchetes vas a poner las caras que quieres borrar.
cmds.select("%s.f[%s]"%(item, face), tgl = True)
cmds.delete()
from PyQt4 import QtGui, QtCore, uic
import maya.cmds as cmds
import sip, os
uiFile = os.path.join(os.path.dirname(__file__), "designer_selectWindow_2.ui")
windowTitle = "Scene Manip"
windowObject = "pySceneManipWin"
def getMainWindow():
from PyQt4 import QtGui, QtCore #QtCore added
import maya.cmds as cmds #######Added
import sip
windowTitle = "Scene Manip"#######Added
windowObject = "pySceneManipWin"#######Added
def getMainWindow():#######Added
import maya.OpenMayaUI as mui#######Added
pointer = mui.MQtUtil.mainWindow()#######Added
from PyQt4 import QtGui
class SceneManipWin(QtGui.QWidget):
def __init__(self):
super(SceneManipWin, self).__init__()
#Building a layout
self.gridLayout = QtGui.QGridLayout()
self.setLayout(self.gridLayout)
import socket, os
from org.gjt.sp.jedit import Macros
#Grabs the currently selected text or else grabs the document
curText = (textArea.getSelectedText())
if not curText:
curText = (textArea.getText())
#Only goes forward if there is some text to work with
if curText:
import maya.cmds as cmds
if not cmds.commandPort('localhost:6000', q=True):
cmds.commandPort(name='localhost:6000')
import socket
mayaSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mayaSocket.connect(('localhost', 6000))
mayaSocket.send("print what")
mayaSocket.close()