How to convert vertex group to vertex paint data (or the other way around)

I have an object with certain vertices that I want to have a secondary material. They are in their own vertex group.
How can I convert this vertex group data to vertex paint data?
I only really need a mask, so black for one material and white for the other is sufficient.

If the reverse can be done that might be useful too - vertex paint data to vertex group data.

Any help appreciated.

Thank you! :smiley:
As for many things, I hope they eventually build this sort of functionality into Blender as a standard feature.
I think this add-on will do the trick though. Glad someone made this.