This file contains hidden or 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 code | |
def get_module_docstring(filepath): | |
"Get module-level docstring of Python module at filepath, e.g. 'path/to/file.py'." | |
co = compile(open(filepath).read(), filepath, 'exec') | |
if co.co_consts and isinstance(co.co_consts[0], basestring): | |
docstring = co.co_consts[0] | |
else: | |
docstring = None | |
return docstring |
This file contains hidden or 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
# Python port of Paul Bourke's http://local.wasp.uwa.edu.au/~pbourke/fractals/lyapunov/gen.c | |
# By Johan Bichel Lindegaard - http://johan.cc | |
import math | |
import random | |
from PIL import Image, ImageDraw | |
import argparse | |
import os | |
parser = argparse.ArgumentParser(description='Search for chaos.') |
This file contains hidden or 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 | |
''' | |
hogGenGradient.py | |
~~~ | |
A script built on PIL to convert an image to 8-bit heightmap and a | |
luminance sorted gradient map. | |
Requirements: PIL, numpy | |
Tested mainly in Python 2.7 (also limited tests in 2.6.4) |
This file contains hidden or 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 | |
__author__ = '[email protected]' | |
## reference: https://gist.github.com/bjorn/4635382 | |
# -- This line is 75 characters ------------------------------------------- | |
# example code |
This file contains hidden or 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 | |
#-------------------------------------------------------------------------- | |
def synthesize(inst, name, value, readonly=False): | |
''' | |
This is a convenience method for OOP | |
synthesizes the creation of attr with convenience methods: | |
x.attrbute | |
x._attribute # attribute storage |
This file contains hidden or 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 hidden or 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
# fast easy work around for rendering hardware2/viewport2.0 sequence frames in Maya 2016 | |
# you still need to setup for animation in the 'Render Settings' | |
# Change 'Frame/Animation ext:' pull down, so that each frame will be written out | |
# with name frame padding, etc. | |
import maya.cmds as cmds | |
# Settings | |
startFrame = int(cmds.playbackOptions(q=True, min=True)) | |
endFrame = int(cmds.playbackOptions(q=True, max=True)) |
This file contains hidden or 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/python | |
#coding:utf-8 | |
# -- This line is 75 characters ------------------------------------------- | |
""" | |
This script will convert a .HDR (radiance) into a RGBM file, | |
then save it back out as a 8bit (per-channel) .tga | |
""" | |
__author__ = 'HogJonny' | |
# ------------------------------------------------------------------------- |