def rotToQuat(obj):
    """ return the rotation of the object as quaternion"""
    if obj.rotation_mode == 'QUATERNION' or obj.rotation_mode == 'AXIS_ANGLE':
        return obj.rotation_quaternion
    else:
        # eurler
        return obj.rotation_euler.to_quaternion()