1
$\begingroup$

I would like to know if there is a way of manually creating volume grids. Like the data we obtain from mantaflow simulations or import from external vdb files.

For example, is the creation of volume grids exposed in the API? What I would like to do in such case is to manually create a 3d matrix in python inside Blender and directly pass such matrix to a volume object to be rendered. Without having to create an openvdb file and inport it.

$\endgroup$
7
  • $\begingroup$ If you ask for 'best way' to do something, your question is likely to be closed because it is "asking for an opinion". You can create meshes in python, that can then be rendered, including 3D grids of data, and many importers do precisely that. Look into bmesh in the manuals or tutorials for one way to do this. $\endgroup$ Commented Oct 16, 2021 at 14:57
  • $\begingroup$ Thanks for the feedback on the question. I edited it to avoid this problem and make it more clear. I already maneged to create an openvdb file in python and import it into blender. But I would like to know if there is any way we can create the volume grids inside blender. $\endgroup$ Commented Oct 16, 2021 at 16:58
  • $\begingroup$ I think blender.stackexchange.com/questions/238229/… may answer your question. $\endgroup$
    – james_t
    Commented Oct 16, 2021 at 17:57
  • $\begingroup$ @james_t, thank you, but that's not quite it. In the question you posted, the objective is to create points in specific positions with specific velocities, but each point does not contain a scalar value which could be used in shading. I would need for each point (x,y,z) to be related to a density, that could be shaded. $\endgroup$ Commented Oct 16, 2021 at 18:03
  • $\begingroup$ Could you use vertex colors for the density weights? $\endgroup$ Commented Oct 22, 2021 at 22:32

1 Answer 1

0
$\begingroup$

you can write the grid data from python into an openvdb file on disk, and import it into blender. heres a thread that shows some samplecode: Blender and volume object using openvdb and he explains it step by step: https://www.youtube.com/watch?v=x0Zlb7vyaO4&ab_channel=SURFVisualisation

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .