Skip to content

Instantly share code, notes, and snippets.

View stylerhall's full-sized avatar
🌌

Seth Hall stylerhall

🌌
View GitHub Profile
@Alquimista
Alquimista / bezdraw.py
Created October 9, 2011 20:45 — forked from jl2/bezdraw.py
Draw Bezier curves using Python and PyQt
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import math
from PyQt4 import QtGui, QtCore
def binomial(i, n):
@gre
gre / easing.js
Last active June 13, 2024 12:18
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* 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 = {
@amitsaha
amitsaha / inspect_demo.py
Created August 27, 2012 09:04
Demo code using the Python inspect module
''' 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
@BigglesZX
BigglesZX / gifextract.py
Created November 5, 2012 10:31
Extract frames from an animated GIF, correctly handling palettes and frame update modes
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 -
@MattRix
MattRix / RXDivider.cs
Last active May 1, 2024 18:15
Adds dividers into the inspector. Based on a brilliant idea by Matthew Wegner, see: https://twitter.com/mwegner/status/355147544818495488
//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;
@evitolins
evitolins / RRM_utils.py
Last active December 21, 2023 18:45
Maya Python Snippets
'''
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);")
@theodox
theodox / FBX Wrapper.py
Last active December 19, 2021 12:05
FBXWrapper
'''
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:
@hogjonny
hogjonny / substancePythonBatch.py
Created February 25, 2015 18:13
Basic python formatting for a working example of accessing Allegorithmic Substance BatchTools via script.
#!/usr/bin/env python
#coding:utf-8
# -- This line is 75 characters -------------------------------------------
__author__ = 'HogJonny'
import os, sys
import subprocess
@KeyMaster-
KeyMaster- / polarWarp.glsl
Created April 4, 2015 21:27
Cartesian to Polar coordinates warp shader, for shadertoy.com
//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;
@EricTRocks
EricTRocks / QSliderWithText.py
Created April 19, 2016 19:41
QSlider with Text showing Value
from PySide import QtCore, QtGui, QtOpenGL
class SliderWithValue(QtGui.QSlider):
def __init__(self, parent=None):
super(SliderWithValue, self).__init__(parent)
self.stylesheet = """