Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Israel justinfx

View GitHub Profile
@justinfx
justinfx / mayaQtEmbedRenderView.py
Last active Aug 29, 2015
Maya / PyQt: A variation of https://gist.github.com/justinfx/1381489 where we embed the Render View, instead
View mayaQtEmbedRenderView.py
from PyQt4 import QtCore, QtGui
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
global app
@justinfx
justinfx / qtWidgetLeaks.py
Last active Aug 29, 2015
A helper class for monitor widget growth and trying to track if instances are leaking
View qtWidgetLeaks.py
import pprint
import datetime
from collections import defaultdict
from PySide import QtCore, QtGui
class WidgetLeakWatcher(QtCore.QObject):
"""
Monitor the growth or existance of widgets in
the application, at intervals.
@justinfx
justinfx / convert_imagick.go
Last active Aug 29, 2015
comparing OpenImageIGO to iMagick
View convert_imagick.go
package main
import (
"github.com/justinfx/imagick/imagick"
"runtime"
)
const (
WIDTH = 320
HEIGHT = 240
@justinfx
justinfx / go_test.go
Created Dec 16, 2014
Some basic benchmarks of fileseq vs gofileseq vs seqls
View go_test.go
package main
import (
"github.com/justinfx/gofileseq"
"testing"
)
func BenchmarkGoSeq10(b *testing.B) {
var res fileseq.FileSequences
var err error
@justinfx
justinfx / web_threads.py
Created Dec 27, 2014
Example of using worker QThreads to process data before loading web results. (pyside, qt)
View web_threads.py
from PySide import QtCore, QtGui, QtWebKit
from threading import current_thread
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
container = QtGui.QWidget(self)
@justinfx
justinfx / EyeRig.py
Created Jul 27, 2011
python_inside_maya - Rewrite this as a Python Class?
View EyeRig.py
import maya.cmds as cmds
class EyeRig(object):
"""
EyeRig
Usage:
eyeRig = EyeRig()
eyeRig.create('testX_eyeL', 'testX_eyeL_tgt', ['anim', 'aim', 'out'])
@justinfx
justinfx / stress_test.go
Created Aug 26, 2011
go-socket.io stress_test
View stress_test.go
package socketio
import (
"testing"
"os"
"flag"
"strconv"
"sync"
"fmt"
"http"
@justinfx
justinfx / modelPanelPyQt4.py
Created Nov 21, 2011
Mixing PyQt4 and Maya UI objects
View modelPanelPyQt4.py
from PyQt4 import QtCore, QtGui
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
global app
@justinfx
justinfx / interfaces.py
Created Dec 27, 2011
An alternative to doing switches in OOP
View interfaces.py
#!/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
@justinfx
justinfx / float2ptr.py
Created Jan 26, 2012
Generating a list of Float2 pointers using MScriptUtil
View float2ptr.py
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)]