This is a follow up of the previous commit. These functions are useful for other areas of Blender as well.