This file contains 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 | |
class EyeRig(object): | |
""" | |
EyeRig | |
Usage: | |
eyeRig = EyeRig() | |
eyeRig.create('testX_eyeL', 'testX_eyeL_tgt', ['anim', 'aim', 'out']) |
This file contains 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
package socketio | |
import ( | |
"testing" | |
"os" | |
"flag" | |
"strconv" | |
"sync" | |
"fmt" | |
"http" |
This file contains 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 PyQt4 import QtCore, QtGui | |
import maya.cmds as cmds | |
import maya.OpenMayaUI as mui | |
import sip | |
global app |
This file contains 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 PyQt4 import QtCore, QtGui | |
import maya.cmds as cmds | |
import maya.OpenMayaUI as mui | |
import sip | |
class MyDialog(QtGui.QDialog): |
This file contains 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 re | |
import maya.cmds as cmds | |
def getSelectedInts(): | |
rx = re.compile(r'\[(\d+)\]$') | |
intList = [] | |
sel = cmds.ls(sl=True) | |
if not sel: | |
return "", [] |
This file contains 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
#!/usr/bin/env python | |
""" | |
Based on the this SO question: | |
http://stackoverflow.com/questions/126409/ways-to-eliminate-switch-in-code | |
Ways to use object oriented programming to create interfaces | |
instead of using switch patterns like: | |
if | |
elif |
This file contains 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 OpenMaya | |
import random | |
import sys | |
ptrArray = [] | |
numObjs = 4 | |
print "Before" | |
for obj in range(numObjs): | |
data = [random.uniform(0,1), random.uniform(0,1)] |
This file contains 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.OpenMaya as OpenMaya | |
from maya.OpenMayaFX import MFnParticleSystem | |
from maya.OpenMaya import MPoint, MPointOnMesh, MVector, MFloatPoint | |
import maya.cmds as cmds | |
import time | |
from operator import itemgetter | |
This file contains 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 PyQt4 import QtCore, QtGui | |
class Dialog(QtGui.QDialog): | |
def __init__(self, parent=None): | |
super(Dialog, self).__init__(parent) | |
self.resize(300,200) | |
def showEvent(self, event): |
This file contains 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
class AttrFieldGroup(QtGui.QWidget): | |
""" | |
AttrFieldGroup | |
Resembles a attrFieldSliderGrp widget in the Maya UI. | |
This is a basic example. You could go further in setting | |
up a common setRange() to configure both the text input and | |
the slider together. | |
""" |
OlderNewer