* The object rotation was based on ob->rot (which only includes object's own rotation) instead of ob->obmat, which includes parent rotations as well.
* The object rotation was based on ob->rot (which only includes object's own rotation) instead of ob->obmat, which includes parent rotations as well.