Built into maya since version 2 (thats year 2002 approximately). Called artisan theres a example script thet does this that ships with maya (you can extend it).
Choose Modift -> Paint Scripts tool
then open the tool option (doubleclick on sacred tool icon), expand setup and type geometryPaint into the setup field.
Anyway its just a demo you can expand it and make it more accessible if you want to.