Armin Halac shows how to write a script for Autodesk Maya that will allow you to evenly split a joint and add new joints, which can be useful when you need to add some joints for twst action on an existing joint chain.

how to write a script that can evenly split a bone and add new joints

Using PyMEL and a bit of math, Armin walks through the concepts and shows how to recreate the joint hierarchy and generate new joints and how to position them on the calculated locations. When completed, the script will also automatically name the new joints while keeping the original joint orientations.