Showing posts with label bone. Show all posts
Showing posts with label bone. Show all posts

Saturday, 27 November 2010

Au Soleil at the London Underground Film Festival (LUFF)

I'm really happy to have heard from the London Underground Film Festival that my short 'Au Soleil' will be screening at the Horse Hospital next Saturday the 4th December, as part of their programme Around the Compass Rose: Human Geographies on Film.  'Au Soleil' was nominated for the technical achievement award at CAM*ERA earlier in the year.  It seems like ages since I finished work on this film, and though with hindsight some of the technical work isn't as strong as I would have liked, I hope it goes some way to proving that as a medium animation has more to offer than just tired/banal overworked childrens' entertainment.  Tickets available here £5 or £3 concessions, showing with 'Wild West', 'Faith Hope and Greenland', and 'Those Who Live Off the Dead'.

In completely unrelated news, Campbell Barton did a terrific job last week of bringing blender's rigging tools slightly further out of the stone age by fixing the infamous bone roll bug (which has been in blender for nearly as long as I can remember).  It seems that all of the devs have been completely oblivious to it, and no riggers have ever got round to reporting it as it was fixed just hours after I reported it!  Not only that, but Campbell has also added a few more options to the menu giving a choice of which axis to align to (+Y for  a leg IK chain for example).  Commit notes are here for anyone interested: 1 2 3.

Monday, 22 November 2010

Bone Roll in Blender

It's well known that setting bone roll to Z-axis up in blender often doesn't work well, if at all.  If you find yourself having to set bone roll manually using Ctrl+R then this script might help you out.  Tab into bone edit mode, select the bones you want to roll, copy and paste the below script to a text editor, set your target roll vector as new_z_axis_vector in the script below (at the moment its set for z up) and hit run script.

import bpy,mathutils,math

new_z_axis_vector=mathutils.Vector((0,0,1))

for each_bone in bpy.context.selected_bones:
    new_x_axis=each_bone.y_axis.copy().cross(new_z_axis_vector)
    if new_x_axis.copy().angle(each_bone.x_axis)>90:
        new_x_axis=(-1)*new_x_axis
    previous_z_angle=each_bone.z_axis.angle(new_z_axis_vector)
    roll_adjust=each_bone.x_axis.angle(new_x_axis)
    each_bone.roll+=roll_adjust
    if each_bone.x_axis.angle(new_x_axis)>0.01:
        each_bone.roll-=2*roll_adjust


Of course the correct rigging practice is to make sure the bone roll of all the bones in a chain is such that the z axes vectors of all the bones are in the same plane so you might want to set new_z_axis_vector to something other than (0,0,1) or world z, for example a leg IK chain might need a value of (0,1,0) to make all the bone z-axes point forward.