This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |