Skip to content

Instantly share code, notes, and snippets.

View daylanKifky's full-sized avatar

Bruno Laurencich daylanKifky

View GitHub Profile
@daylanKifky
daylanKifky / Armature_points_OSC.py
Last active April 16, 2018 15:44
Send the projected 2D joint points of an armature in Blender trough OSC
# Point projection from:
# - https://blender.stackexchange.com/questions/16472/how-can-i-get-the-cameras-projection-matrix#answer-86570
# (@fnunnari's response)
import bpy
from mathutils import Vector
def project_3d_point(camera: bpy.types.Object,
p: Vector,
@daylanKifky
daylanKifky / bone_co_pose_space.py
Created February 14, 2018 16:07
Get the position of a bone in Blender in pose space
import bpy
from mathutils import *
C=bpy.context
D=bpy.data
def get_bone_co_pose_space(bone_name, tip_or_head):
"""Expects an active Armature object, and if run as main an empty object called "Empty" """
name = bone_name
C.object.data.show_axes = True
@daylanKifky
daylanKifky / mesh_to_json.py
Last active February 6, 2018 17:23
Dump Blender mesh data as Json
import bmesh
import bpy
import json
C = bpy.context
mesh = C.object.data
#Get faces and vertices from the current object
faces = []
@daylanKifky
daylanKifky / index.html
Created January 27, 2018 23:00
Web audio API MediaElement Mixer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AudioMixer</title>
</head>
<body>
<h1>GGJ18 AUDIO MIXER</h1>
<audio id="maria" src="radio_maria.mp3"></audio>
@daylanKifky
daylanKifky / bone_panel.py
Created January 21, 2018 02:28
add a panel in blender from where select a bone from an armature
#----------------------------------------------------------
# File bone_panel.py
#----------------------------------------------------------
import bpy
#
# Menu in tools region
# see https://wiki.blender.org/index.php/Dev:Py/Scripts/Cookbook/Code_snippets/Interface
class ToolsPanel(bpy.types.Panel):
bl_label = "Pointer prop test"
import numpy
import pandas
from keras.models import Sequential
from keras.layers import Dense
from keras import optimizers
from keras import regularizers
# load dataset
dataframe = pandas.read_csv("some_quaternions.csv", delim_whitespace=False, header=None)
dataset = dataframe.values
@daylanKifky
daylanKifky / shuffle.py
Created April 13, 2017 10:09
distribute list shuffle python
a = [a for a in range(20)]
from random import shuffle
shuffle(a)
print a
#[13, 2, 4, 5, 10, 3, 0, 9, 14, 12, 8, 11, 7, 6, 15, 16, 17, 18, 1, 19]
lista = [[],[],[]]
for i,val in enumerate(a):
lista[i%3].append(val)
print lista