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 | |
# -*- coding: utf-8 -*- | |
import sys | |
import math | |
from PyQt4 import QtGui, QtCore | |
def binomial(i, 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
/* | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See the COPYING file for more details. | |
*/ | |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { |
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
''' Demo script experimenting with various features of the | |
inspect module | |
''' | |
# To be run with Python3.3 | |
from inspect_test import MyClass | |
from inspect_test import myfunc | |
from inspect_test import mygen |
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 os | |
from PIL import Image | |
''' | |
I searched high and low for solutions to the "extract animated GIF frames in Python" | |
problem, and after much trial and error came up with the following solution based | |
on several partial examples around the web (mostly Stack Overflow). | |
There are two pitfalls that aren't often mentioned when dealing with animated GIFs - |
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
//Based on a brilliant idea by Matthew Wegner - https://twitter.com/mwegner/status/355147544818495488 | |
//Code for drawing the base PropertyDrawers is from here: http://forum.unity3d.com/threads/173401-Getting-Default-SerializedProperty-Drawing-within-a-PropertyDrawer?p=1186347&viewfull=1#post1186347 | |
//My implementation is super lazy with magic numbers everywhere! :D | |
#if UNITY_EDITOR | |
using System; | |
using UnityEngine; | |
using System.Collections.Generic; | |
using UnityEditor; |
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
''' | |
This fixes a RRM bug (v1.4.7) where saved RRM setups do not preserve a | |
module's 'pinned' status. | |
''' | |
import maya.cmds as cmds | |
import maya.mel | |
def RRM_fixPinBug(objs): | |
for obj in objs: | |
trans = cmds.xform(obj,q=True, r=True, translation=True) | |
maya.mel.eval("RRM_PinProxies(1, 0);") |
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
''' | |
FBXWrapper | |
This module provides a python wrapper for every method exposed in the FBX plugin. | |
The arguments for the calls are the same as for the equivalent mel calls, however they can be passed with typical | |
python syntax, which is translated to mel-style flags and arguments under the hood. The actual flags and arguments | |
are documented here: | |
usage: |
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 | |
#coding:utf-8 | |
# -- This line is 75 characters ------------------------------------------- | |
__author__ = 'HogJonny' | |
import os, sys | |
import subprocess |
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
//To be used on shadertoy.com | |
//Uses the image at iChannel0 and warps it into polar coordinates | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec2 relativePos = fragCoord.xy - (iResolution.xy / 2.0); | |
vec2 polar; | |
polar.y = sqrt(relativePos.x * relativePos.x + relativePos.y * relativePos.y); | |
polar.y /= iResolution.x / 2.0; | |
polar.y = 1.0 - polar.y; |
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 PySide import QtCore, QtGui, QtOpenGL | |
class SliderWithValue(QtGui.QSlider): | |
def __init__(self, parent=None): | |
super(SliderWithValue, self).__init__(parent) | |
self.stylesheet = """ |
OlderNewer