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. | |
""" |
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 matplotlib.pyplot as plt | |
from random import randint | |
from time import time | |
DATA = [ | |
(i, randint(5,30), randint(5,30), randint(30,35), randint(1,5)) \ | |
for i in xrange(1, 401) | |
] | |
def mapValues(group): |
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
#move vertices as rod goes over it | |
import maya.OpenMaya as om | |
import maya.cmds as cmds | |
import math as m | |
class vertexInfo(object): | |
def __init__(self): | |
self.verX = [] | |
self.verY = [] | |
self.verZ = [] |
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.QtCore import * | |
from PyQt4.QtGui import * | |
class ListOrderView(QListView): | |
itemMoved = pyqtSignal(int, int, QStandardItem) | |
def __init__(self, parent=None): | |
super(ListOrderView, self).__init__(parent) |
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
""" | |
setup.py | |
py2app setup script for creating a semi-standalone .app | |
around a Maya API based PyQt4 application. | |
Only bundled PyQt4 with the app, and references the Maya install | |
location for the python environment. | |
Allows for a portable GUI application that does not require |
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 | |
""" | |
Copyright (c) 2012, Justin Israel (justinisrael@gmail.com) | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, |
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 inspect | |
def trace(): | |
frames = (str(f[1:4]) for f in inspect.getouterframes(inspect.currentframe())[1:]) | |
print "\n".join(frames) | |
print '\n' |
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
#!/bin/bash | |
if [ -z $1 ] || [ ! -d ${1}/server ]; then | |
echo "plow_rebuild.sh <path to plow source>" | |
exit 1 | |
fi | |
realpath1() { | |
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${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
#!/usr/bin/env python | |
""" | |
Showing a test, inside and outside of Maya, | |
of child windows still remaining alive after being closed. | |
Test can toggle the WA_DeleteOnClose attribute on each child widget: | |
# Command line (dont delete) | |
$ ./child_window_test.py |
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
""" | |
ActiveState: | |
http://code.activestate.com/recipes/578634-pyqt-pyside-thread-safe-callbacks-main-loop-integr/ | |
ref and proxy classes are based on: | |
http://code.activestate.com/recipes/81253/#c5 | |
Modified proxy to support a quiet concept for callbacks that can | |
simply pass if they were not valid, instead of raising an exception. |