Vertex painting amd editing volumes with Python

I have 2 tasks
First - I need to paint some vertex in mesh with color - how?
Second - I have volume (Cube with volume mat.) and algorithm what determine some params (density and color) in every point of volume. Is it possible to write this params to volume in Blender? (It will be some kind of scientific visualization)

well if you can get the parameters in python/blender, you can find your active material and assign the value to the density and color value. i don’t know about vertex painting.

Yes, I know how to change density and other stuff em… globaly - like from Blender UI. But I need to set proper values for every voxel of volume

i dont’t know too much about voxel stuff, but you can change it per material/texture, and if per voxel is possible in normal blender it’s possible through python.

Well, thanks to Matt Ebb now I know. First I need to write my voxel data to file and then use it like a 3D-texture