Skip to content

Instantly share code, notes, and snippets.

View zeffii's full-sized avatar

Dealga McArdle zeffii

View GitHub Profile
import bpy
from mathutils import Vector
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((2,0,0,1)),((2,3,0,1)),((0,2,0,1))]
# create a spline curve from a number of points
def MakePolyLine(objname, curvename, cList):
curvedata = bpy.data.curves.new(name=curvename, type='CURVE')
curvedata.dimensions = '2D'
@zeffii
zeffii / blender_polyline.py
Created August 9, 2011 06:41
adding polyline in blender 2.5
import bpy
from mathutils import Vector
listOfVectors = [((0,0,0,1)),((1,0,0,1)),((2,0,0,1)),((2,3,0,1)),((0,2,0,1))]
# create a spline curve from a number of points
def MakePolyLine(objname, curvename, cList):
curvedata = bpy.data.curves.new(name=curvename, type='CURVE')
curvedata.dimensions = '2D'
@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 / automatic_text_preferences.py
Created August 10, 2011 09:29
small panel for 'TEXT_EDITOR' blender 2.5
import bpy
class SetTextPreferences(bpy.types.Operator):
bl_label = "Set Text Preferences"
bl_idname = "txt.set_text_prefs"
def execute(self, context):
st = context.space_data
st.show_line_numbers = True
@zeffii
zeffii / automatic_text_preferences2.py
Created August 10, 2011 11:33
prepending a button to a header
import bpy
class SetTextPreferences(bpy.types.Operator):
bl_label = ""
bl_idname = "txt.set_text_prefs"
def execute(self, context):
st = context.space_data
st.show_line_numbers = True
@zeffii
zeffii / chroma_button_text_editor.py
Created August 10, 2011 11:49
place colour button infront of all other buttons on the text editor window blender
bl_info = {
'name': 'Text Editor Chroma key',
'author': 'Dealga McArdle (zeffii) <digitalaphasia.com>',
'version': (0, 7, 0),
'blender': (2, 5, 9),
'location': 'text editor > header > chroma button',
'description': 'makes it all pretty',
'wiki_url': '',
'tracker_url': '',
'category': 'Text Editor'}
@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 / text_editor_chroma_button.py
Created August 10, 2011 19:55
text editor chroma button
bl_info = {
'name': 'Text Editor Chroma key',
'author': 'Dealga McArdle (zeffii) <digitalaphasia.com>',
'version': (0, 7, 0),
'blender': (2, 5, 9),
'location': 'text editor > header > chroma button',
'description': 'makes it all pretty',
'wiki_url': '',
'tracker_url': '',
'category': 'Text Editor'}
@zeffii
zeffii / keyframe_coordinates_of_curve.py
Created August 11, 2011 13:42
scripted keyframing of curve coordinates in blender
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))]
]