# VTK to OpenVDB file format

**URL:** https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322
**Category:** Support
**Tags:** file-formats
**Created:** [August 8, 2021, 6:06am UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322 "2021-08-08T06:06:41Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![tkeskita](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tkeskita/32/1757_2.png) [@tkeskita](https://discourse.vtk.org/u/tkeskita)
#### Post date: [August 8, 2021, 6:06am UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/1 "2021-08-08T06:06:41Z")

</div>

Hi,

This post was created to summarize current status of **possibilities to convert/export VTK 3D image data into [OpenVDB](https://www.openvdb.org/) volumetric voxel data / grid format (.vdb)**. This is getting to be a frequently asked question, so I hope to redirect people to this thread in future.

Please feel free to post with updates and corrections, I hope somebody will work to improve the situation at some point.

- **No native VTK exporter** for OpenVDB exists AFAIK.

- **C++ solution:** Install OpenVDB and VTK libraries, then create a customized C++ program yourself to export your data to OpenVDB.

- **Python solution:** Use VTK via Python and [pyopenvdb](https://www.openvdb.org/documentation/doxygen/python.html). This requires that you can both `import vtk` and `import pyopenvdb` in your Python environment.

- **[BVTKNodes add-on for Blender:](https://bvtknodes.readthedocs.io/en/latest/)** There is [VTK To OpenVDB Exporter node](https://bvtknodes.readthedocs.io/en/latest/BVTKNodes.html#vtk-to-openvdb-exporter), but you must learn how to use it. It’s using the Python solution above, using JSON as an intermediate data export format.

BR,  
Tuomo

---

<div class="post-metadata">

### Author: ![Andrew](https://discourse.vtk.org/user_avatar/discourse.vtk.org/andrew/32/3861_2.png) [@Andrew](https://discourse.vtk.org/u/Andrew)
#### Post date: [August 8, 2021, 8:55pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/2 "2021-08-08T20:55:31Z")

</div>

Believe [https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/8024](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8024) was just merged to master last week. Requires some legwork with boost+openvdb.

---

<div class="post-metadata">

### Author: ![acbauer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/acbauer/32/320_2.png) [@acbauer](https://discourse.vtk.org/u/acbauer)
#### Post date: [August 10, 2021, 1:41pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/3 "2021-08-10T13:41:41Z")

</div>

Yes, you can now write out OpenVDB files from VTK using the VTK master. In my opinion it works best for `vtkImageData` but should work for most other `vtkDataSets` as well. If you try the `vtkOpenVDBWriter` out and have issues or recommended improvements, please let me know so that I can improve upon it. It does require third party libraries such as OpenVDB and all of its dependencies (Boost, OpenEXR, etc.).

---

<div class="post-metadata">

### Author: ![tkeskita](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tkeskita/32/1757_2.png) [@tkeskita](https://discourse.vtk.org/u/tkeskita)
#### Post date: [August 10, 2021, 2:41pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/4 "2021-08-10T14:41:35Z")

</div>

Great news! So it is just a matter of building it (and dependencies) now already. Is there a ready built installation package available somewhere (with dependencies)? This is what most users wil ask for.

---

<div class="post-metadata">

### Author: ![Sam\_Tang](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sam_tang/32/3173_2.png) [@Sam\_Tang](https://discourse.vtk.org/u/Sam_Tang)
#### Post date: [August 11, 2021, 3:35pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/5 "2021-08-11T15:35:51Z")

</div>

hi,I builded paraview from the updated source can’t find openvdb file converting output.  
[https://discourse.paraview.org/t/vdb-files/640/10](https://discourse.paraview.org/t/vdb-files/640/10)  
Should I let VTK\_ENABLE\_OPENVDB ON when build VTK?

---

<div class="post-metadata">

### Author: ![acbauer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/acbauer/32/320_2.png) [@acbauer](https://discourse.vtk.org/u/acbauer)
#### Post date: [August 12, 2021, 12:24pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/6 "2021-08-12T12:24:28Z")

</div>

I’m not aware of an installation package. VTK has a diverse set of options with a diverse set of dependencies (OpenVDB, NetCDF, MPI, HDF5, …) that are continually being updated. Supporting all of these simultaneously and continually for a package manager could be a significant undertaking.

---

<div class="post-metadata">

### Author: ![acbauer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/acbauer/32/320_2.png) [@acbauer](https://discourse.vtk.org/u/acbauer)
#### Post date: [August 12, 2021, 12:27pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/7 "2021-08-12T12:27:20Z")

</div>

It will need maybe a month before the OpenVDB writer is available in ParaView in order to get that extra work done. To enable the OpenVDB writer in VTK you’ll need to enable the `VTK_ENABLE_OPENVDB` option, which is an advanced CMake option.

---

<div class="post-metadata">

### Author: ![Sam\_Tang](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sam_tang/32/3173_2.png) [@Sam\_Tang](https://discourse.vtk.org/u/Sam_Tang)
#### Post date: [August 19, 2021, 1:08pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/9 "2021-08-19T13:08:45Z")

</div>

hi tkeskitalo,can you add this file volume\_00001.json? Thanks.  
[https://bvtknodes.readthedocs.io/en/latest/BVTKNodes.html#vtk-to-blender-volume](https://bvtknodes.readthedocs.io/en/latest/BVTKNodes.html#vtk-to-blender-volume)

---

<div class="post-metadata">

### Author: ![tkeskita](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tkeskita/32/1757_2.png) [@tkeskita](https://discourse.vtk.org/u/tkeskita)
#### Post date: [August 20, 2021, 1:23pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/10 "2021-08-20T13:23:00Z")

</div>

Sounds like you are trying to use [VTK To OpenVDB Exporter Node in BVTKNodes](https://bvtknodes.readthedocs.io/en/latest/BVTKNodes.html#vtk-to-openvdb-exporter)? It should create the JSON file upon running **Export**. Please, if you have BVTKNodes problem (and not a VTK question), kindly post it to [BVTKNodes github issues](https://github.com/tkeskita/BVtkNodes/issues) (please also [read instructions](https://bvtknodes.readthedocs.io/en/latest/BVTKNodes.html#help-with-issues)) and not here.

---

<div class="post-metadata">

### Author: ![Sam\_Tang](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sam_tang/32/3173_2.png) [@Sam\_Tang](https://discourse.vtk.org/u/Sam_Tang)
#### Post date: [August 27, 2021, 8:22am UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/11 "2021-08-27T08:22:42Z")

</div>

hi tkeskita,  
How to convert this data:  
[json2vdb.json - Google Drive](https://drive.google.com/file/d/1SOwXD5xOR5L5kmNDHDC752sNDdmdRQWX/view?usp=sharing) ?  
I got this error:

 ![Screenshot from 2021-08-27 16-05-41](https://discourse.vtk.org/uploads/default/original/2X/f/f8e19ab2b0fef6b58707ed9846479f239cb93745.png)  
How to convert to vdb from json data?  
[No title (8\_26\_2021 3\_51\_43 PM).html](https://discourse.vtk.org/uploads/short-url/e8DnzxDUvVyIyi5bf5ViOVlD9KQ.html) (4.1 KB)  
Thank you very much.

---

<div class="post-metadata">

### Author: ![tkeskita](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tkeskita/32/1757_2.png) [@tkeskita](https://discourse.vtk.org/u/tkeskita)
#### Post date: [September 11, 2021, 12:17pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/12 "2021-09-11T12:17:43Z")

</div>

Kindly post this question to [BVTKNodes github issues](https://github.com/tkeskita/BVtkNodes/issues).

---

<div class="post-metadata">

### Author: ![Fernando\_Zigunov](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fernando_zigunov/32/10054_2.png) [@Fernando\_Zigunov](https://discourse.vtk.org/u/Fernando_Zigunov)
#### Post date: [June 1, 2025, 10:23pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/13 "2025-06-01T22:23:58Z")

</div>

None of these helped me so I eventually figured out the best way to get my data into Blender. It doesn’t use VTK but it works - AND IT WORKS ON WINDOWS, which literally seems to not exist anywhere in the internet (I spent 5 hours researching!!!).

Run this code in Blender Python:

(the variable rhoVolume is a dataset in the HDF5 file)

```auto
import openvdb as vdb
import h5py
import os

workingFolder="C:/Path/To/Your/File/"

h5_path = os.path.join(workingFolder, "Test10.h5")
vdb_path = os.path.join(workingFolder, "Test10.vdb")

f=h5py.File(h5_path,'r+')

key=list(f.keys())[0]
data = f["rhoVolume"][()]

grid = vdb.FloatGrid()
grid.copyFromArray(data)

grid.name = "rhoVolume"

vdb.write(vdb_path, grids=[grid])

print("VDB saved!!")

```

This works on Windows 10, with Blender 4.4.3 as of June 2025. Looks like Blender has openvdb compiled within itself, which means you just need to get the data in the Blender Python. I’m sure you can figure out how to do it in VTK too, but I’m honestly completely gassed out and annoyed I spent so much time on this. Hopefully this helps somebody in the future…

---

<div class="post-metadata">

### Author: ![omdaniel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/omdaniel/32/8538_2.png) [@omdaniel](https://discourse.vtk.org/u/omdaniel)
#### Post date: [June 6, 2025, 2:48pm UTC](https://discourse.vtk.org/t/vtk-to-openvdb-file-format/6322/14 "2025-06-06T14:48:08Z")

</div>

@Fernando_Zigunov Thanks for sharing, I have plans to take volume data from vtk to blender with openvdb. Having the density stored as attribute accessible by blender is great. I hope to also store the velocity vectors for each grid point in the volume which can be used by blender for motion blur and if I can get that working I will add to this post.
