Patch from Jason Wilkins: http://projects.blender.org/tracker/index.php?func=detail&aid=30350&group_id=9&atid=127