Skip to content

Instantly share code, notes, and snippets.

pink-vertex

Block or report user

Report or block pink-vertex

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View obr_tools.py
import os
import gzip
from ctypes import *
# NOTE Select a single cube extrude it 1 block and execute "/pastebrush py" or "/pastebrush house"
# /pastebrush does not! work with block range selections (blue selection box) and
# only overrides cubes in the selection according to some rules
# i.e. cubes of air material do not override/replace existing cubes
# orientation up 4(or down 5) means dimension is 4 >> 1 == 2, row R[2] == 0, column C[2] == 1, depth D[2] == 2
# dimension coord (orient & 1) does matter (see blockcube(...)) and determines direction
View pose_bone_matrix.py
import bpy
from mathutils import Matrix, Vector
# ported from blenkernel/intern/armature.c to python
# --------------------------------------------------------------------
def get_mat_offs(pose_bone):
bone = pose_bone.bone
mat_offs = bone.matrix.to_4x4()
mat_offs.translation = bone.head
mat_offs.translation.y += bone.parent.length
@pink-vertex
pink-vertex / c_types_vfont.py
Created Oct 29, 2015
breakdown text curve into characters (experiment - tested on ubuntu 2.75a 64bit)
View c_types_vfont.py
import bpy
import mathutils
import ctypes
c_int_p = ctypes.POINTER(ctypes.c_int)
c_float_p = ctypes.POINTER(ctypes.c_float)
class BezTriple(ctypes.Structure):
_pack_ = 8
_fields_ = [
@pink-vertex
pink-vertex / convert_anim.py
Created Sep 25, 2015
Applies parent inverse matrix to the child's local matrix.
View convert_anim.py
import bpy
import mathutils
class Converter:
def __init__(self, ob, logging=False):
self.ob = ob
self.action = ob.animation_data.action
self.rot_mode = ob.rotation_mode
self.logging = logging
You can’t perform that action at this time.