Apr 122011
 

I started on a script to allow real time mocap in Blender via. a socket connection to Brekel Kinect

I got it about 60% working. The problem is bizarre. Legs, torso, and head track fine, but shoulder and elbow rotations are completely out of whack.

I posted asking for help on Blender Artists and didn’t get any responses.

Got side-tracked on some other things but I thought I’d stay up-to-date and post what I have here in case it’s just what you’re looking for, or close enough to get you on the right track. If so- let me know how it goes!

Here’s the .blend file.

Just run Brekel-Kinect (I use v.40) and turn NITE tracking on. Then load this .blend and run the game (‘P’) (make sure GAMEempty BOOL game property is ‘FALSE’ or server will not start)

Feb 272011
 

This is a very simple script I wrote to make BVH’s exported from DANCE (Dynamic Animation and Control Environment) able to be imported into Blender.

It just adds blank channels to joints if there are less than 3.

"""
DANCE BVH EXPORT THING
-Simple BVH file thing that adds blank channels of
    position to JOINTS and FRAMES to allow BVH Exports from 
    DANCE (Dynamic Animation and Control Environment) to be
    imported into Blender.
teldredge - www.funkboxing.com
"""

infile = "c:\workspace\bvhMINE\bvhdata\skelORIG2.bvh"
outfile = "c:\workspace\bvhMINE\bvhdata\skelTESTOUT.bvh"

def loadDANCEBVH(fin, fout):
    tab = chr(9)
    f = open(fin, 'r')
    lines = f.readlines()
    f.close()
    
    newlines = list(lines)
    newlines[16] = str(tab+tab+tab+tab+"CHANNELS 3 Xrotation Yrotation Zrotationn")
    newlines[30] = str(tab+tab+tab+tab+"CHANNELS 3 Yrotation Xrotation Zrotationn")
    newlines[34] = str(tab+tab+tab+tab+"CHANNELS 3 Yrotation Zrotation Xrotationn")
    newlines[49] = str(tab+tab+tab+tab+"CHANNELS 3 Yrotation Xrotation Zrotationn")    
    newlines[53] = str(tab+tab+tab+tab+"CHANNELS 3 Yrotation Zrotation Xrotationn")    
    newlines[69] = str(tab+tab+tab+tab+"CHANNELS 3 Xrotation Yrotation Zrotationn")    
    newlines[73] = str(tab+tab+tab+tab+"CHANNELS 3 Xrotation Zrotation Yrotationn")    
    newlines[88] = str(tab+tab+tab+tab+"CHANNELS 3 Xrotation Yrotation Zrotationn")
    newlines[92] = str(tab+tab+tab+tab+"CHANNELS 3 Xrotation Zrotation Yrotationn")    

    for li in range(104, len(lines)):
        vals = lines[li].split(" ")
        vals.insert(12, '0')
        vals.insert(12, '0')
        vals.insert(19, '0')
        vals.insert(21, '0')
        vals.insert(27, '0')
        vals.insert(30, '0')
        vals.insert(30, '0')
        vals.insert(35, '0')
        vals.insert(35, '0')
        vals.insert(39, '0')
        vals.insert(44, '0')
        vals.insert(44, '0')
        vals.insert(48, '0')
        newlines[li] = " ".join(vals) 
    
    fo = open(fout, 'w')
    fo.writelines(newlines)
        
        
        
        
loadDANCEBVH(infile, outfile)