Skip to content

Instantly share code, notes, and snippets.

View polyline_curve_from_coordinate_list.py
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 Aug 9, 2011
adding polyline in blender 2.5
View blender_polyline.py
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 Aug 9, 2011
i dont understand how to script keyframe ShapeKeys
View scripting_shapekeys_kframe.py
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 Aug 9, 2011
almost creating shapekeys from a list
View shapekeys_blender_curve.py
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 Aug 10, 2011
small panel for 'TEXT_EDITOR' blender 2.5
View automatic_text_preferences.py
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 Aug 10, 2011
prepending a button to a header
View automatic_text_preferences2.py
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 Aug 10, 2011
place colour button infront of all other buttons on the text editor window blender
View chroma_button_text_editor.py
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 Aug 10, 2011
scripting shapekey blender 2.5
View shapekeys_blender_scripting.py
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 Aug 10, 2011
text editor chroma button
View text_editor_chroma_button.py
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 Aug 11, 2011
scripted keyframing of curve coordinates in blender
View keyframe_coordinates_of_curve.py
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))]
]