With 2.83 there is now a “VOLUME” object type which can have an bpy.types.Volume data, which is a holder for OpenVDB data.
Is there a way to get the openvdb grid data via the python interface or is it expected a render engine would take the vdb filename from this and get the data itself using the openvdb api. I took a quick look but nothing obvious in python interface. Mainly a question for @brecht but relevant to other render engines I assume.
At the moment the only way is to read the file directly. I should add a property that tells you the file path for the current frame.
In future releases we will support volume modifiers, in which case the volume may only exist in memory. In that case we’ll need Python API access for the OpenVDB grid too. We plan to add pyopenvdb but that probably isn’t for 2.83.
We could add some way to access the OpenVDB grid pointer through the Python API, is that something you would use? Of course your OpenVDB library would have to be the same version as Blender’s (7.0.0 following the VFX reference platform).
I’m not really sure what that would get us any better than the file name and grid channel which is there already… so no, don’t think that’s worth it. Other than not loading the data into blender’s memory and the renderer’s memory…
I’ve added volume.grids.frame_filepath now which gives the filepath for the current frame, which avoids having to construct that manually and reimplement the logic for start/offset/repeat/etc.
I plan to add pointer access, but probably not in 2.83 since there isn’t really any convenient way to do it. Rather this would be available when we add pyopenvdb for Python access to the OpenVDB grids.
Thanks for all the info from people in this thread. I’ve been trying to get this to work as well, as importing volume data from a vti file (volumetric image data, stress, strain, etc.) is extremely important for me.
I see there isn’t much activity lately?
Is there any progress, especially on the pyopenvdb incorporation, or getting this working in 2.9x ?
(edit) Also, I’m kind of new to this, can anyone point me to a simple explanation of where/how I can get the custom build working in Windows? I’ve built blender in the past in visual studio no prob, but it’s been awhile. Maybe there is a pre-built binary for win 64? Thanks!
Just bumping this thread since it’s been a year—has there been any progress towards making volume grid pointer access available? Is pyopenvdb being shipped with Blender yet? I’ve got an addon I want to write that involves directly updating the voxel grid of a volume on a frame-by-frame basis and am curious if there’s any chance of this being made possible soon.