Skip to content

Instantly share code, notes, and snippets.

View zeffii's full-sized avatar

Dealga McArdle zeffii

View GitHub Profile
@zeffii
zeffii / flunkbar
Last active August 29, 2015 14:19 — forked from anonymous/flunkbar
https://github.com/nortikin/sverchok
mkdir ~/BioBlender
git clone https://github.com/MonZop/BioBlender.git ~/BioBlender
ln -s ~/BioBlender ~/.config/blender/%BLENDER_VERSION_NUM%/scripts/addons/BioBlender
== or ==
# in a folder wich contains BioBlender.
git clone https://github.com/MonZop/BioBlender.git BioBlender
@zeffii
zeffii / scripting_shapekeys_kframe.py
Created August 9, 2011 13:45
i dont understand how to script keyframe ShapeKeys
import bpy
from mathutils import Vector
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))]
shapes = [ [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))],
[((0,0,0,1)),((2,0,0,1)),((1,1,0,1)),((0,1,0,1))],
[((0,0,0,1)),((1,0,0,1)),((1,2,0,1)),((0,1,0,1))],
[((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((-1,1,0,1))]
]
@zeffii
zeffii / shapekeys_blender_curve.py
Created August 9, 2011 15:49
almost creating shapekeys from a list
import bpy
from mathutils import Vector
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))]
shapes = [ [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))],
[((0,0,0,1)),((2,0,0,1)),((1,1,0,1)),((0,1,0,1))],
[((0,0,0,1)),((1,0,0,1)),((1,2,0,1)),((0,1,0,1))],
[((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((-1,1,0,1))]
]
@zeffii
zeffii / shapekeys_blender_scripting.py
Created August 10, 2011 12:45
scripting shapekey blender 2.5
import bpy
from mathutils import Vector
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))]
shapes = [ [((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((0,1,0,1))],
[((0,0,0,1)),((2,0,0,1)),((1,1,0,1)),((0,1,0,1))],
[((0,0,0,1)),((1,0,0,1)),((1,2,0,1)),((0,1,0,1))],
[((0,0,0,1)),((1,0,0,1)),((1,1,0,1)),((-1,1,0,1))]
]
@zeffii
zeffii / example_modified.pde
Created December 9, 2011 22:15
super class and inheritance
// super class
import java.util.ArrayList;
class GraphicsObject {
PVector pos;
int overthreshold = 2;
GraphicsObject(PVector _pos) {
pos = _pos;
}
@zeffii
zeffii / imgur_upload_v001.py
Created February 19, 2012 13:07
imgur upload python 3 without external modules
from xml.dom import minidom
from urllib.parse import urlencode
from urllib.request import urlopen
import base64
import os
def upload_image(path_to_image):
url = 'http://api.imgur.com/2/upload.xml'
apikey = '-------- your API key ---------'
@davidchambers
davidchambers / to_hash.coffee
Created April 1, 2012 06:02
Dictionary comprehensions in CoffeeScript
to_hash = (pairs) ->
hash = {}
hash[key] = value for [key, value] in pairs
hash
# usage:
to_hash ([n, n * n] for n in [0..5]) # {0:0, 1:1, 2:4, 3:9, 4:16, 5:25}
@zeffii
zeffii / terminal_colours.py
Created June 17, 2012 10:16
colour printing in terminal.py
# http://www.linuxhomenetworking.com/forums/showthread.php/1095-Linux-console-Colors-And-Other-Trick-s
def printWarning(input):
print("\033[31m%s\033[0m" % input)
def funkyprint(input):
print("\033[36m%s\033[0m" % input)
@zeffii
zeffii / nurbs_surface.py
Created July 23, 2012 15:59
nurbs surface maybe
import bpy
from mathutils import Vector
# surface_points = bpy.context.object.data.splines[0].points
# points = [point.co for point in surface_points]
points = [ Vector((-1.5, -1.5, 1.2507835626602173, 1.0)),
Vector((-1.5, -0.5, 0.0, 1.0)),
Vector((-1.5, 0.5, 0.0, 1.0)),
Vector((-1.5, 1.5, 0.0, 1.0)),
@pcote
pcote / meta_troll.py
Created April 8, 2013 19:49
Playing around with custom class construction just to see how it works. Good dumb fun.
# meta_troll.py
# This is me messing around with Python type constructors just for fun.
# Try and see what happens if you uncomment the __metaclass__ line in Foo.
class TrollType(type):
def __new__(meta, classname, bases, clssDict):
class MyTroll(object):
def say_stuff(self):
print("you mad bro?")
return MyTroll