Skip to content

Instantly share code, notes, and snippets.

@tamask
tamask / io_fbx_target.py
Last active February 6, 2019 06:05
Autoexport to an FBX target file (Blender 2.80)
import os
import bpy
import bpy_extras
import mathutils as mu
from io_scene_fbx import ExportFBX
bl_info = {
'name': 'Autoexport FBX Target (.fbx)',
'author': 'Tamas Kemenczy',
'blender': (2, 80, 0),
; Capslock remapping should be done in the registry to avoid key repeat issues in here
; Capslock::Ctrl
; WheelUp::
; Send {WheelDown}
; Return
; WheelDown::
; Send {WheelUp}
; Return
@tamask
tamask / log.py
Created August 8, 2018 00:44
Route system output (stdout/stderr) of Blender to the app console (put in scripts/startup)
import os
import sys
import bpy
output = None
input = None
info = None
error = None
write = None
@tamask
tamask / export_beziers.py
Last active August 5, 2018 23:23
Blender exporter for beziers
import os
import bpy
import math
import mathutils
bl_info = {
'name': 'Export Beziers (.svg)',
'author': 'Tamas Kemenczy',
'version': (0, 1),
'blender': (2, 6, 9),
@tamask
tamask / plot.py
Last active June 28, 2018 13:06
simple graph/plotter for blender
import bpy
import bmesh
NAME = '(Plot)'
def line(gen):
scene = bpy.context.scene
objects = bpy.data.objects
if NAME in objects:
@tamask
tamask / AutoHotKey.ahk
Last active December 2, 2016 19:50
Emacs keybindings and inverse mouse scroll via AutoHotKey
; Capslock remapping should be done in the registry to avoid key repeat issues in here
; Capslock::Ctrl
WheelUp::
Send {WheelDown}
Return
WheelDown::
Send {WheelUp}
Return
import bpy
import math
import mathutils
bl_info = {
'name': 'Light Vertex Colors',
'author': 'Tamas Kemenczy',
'version': (0, 1),
'blender': (2, 6, 3),
'location': 'View3D > Specials > Light Vertex Colors',
import bpy
import math
import mathutils
def magnitude(v):
return math.sqrt(v.x ** 2 + v.y ** 2 + v.z ** 2)
COLOR = mathutils.Color((1, 1, 1))
RADIUS = 10
@tamask
tamask / acronym.py
Created December 14, 2012 17:43
acronym generator
#!/usr/bin/env python
import sys
last = ''
punc = ','
while True:
c = sys.stdin.read(1)
if c:
@tamask
tamask / vector2.js
Created December 7, 2012 16:48
Vector2
Vector2.prototype = {
init: function(x, y) {
this.x = x;
this.y = y;
},
copy: function() {
return new Vector2(this.x, this.y);
},