Rectangular Datasets and Still Frame features

New proposal to commit for Sim_physics

Hi all! 🙂

Currently the handling of voxeldata is implemented without any kind of header for the sake of simplicity and because it was implemented as a test framework of future implementation in that direction (since datasets are one of the most powerful features of a volumetric engine). But voxeldata have started to being used for some serious scientific projects to import datasets into Blender, allowing it to easily fit into more scientific pipelines than before,  that ́s why at least a basic header should be implemented, that will allow:

– ­Automatic resolution detection:   The user no longer needs to manually set up the resolution of the dataset, a very dangerous procedure.

– ­Rectangular datasets: Previously only regular datasets (NxNxN sizes) were supported; now are possible any
combinations of NxMxK sizes

– Another important feature is the possibility to render only a single frame of the dataset during a whole animation, that ́s why I added the “Still” feature.

In the future more improvements could and should be done in that area as Blender starts to being used in scientific pipelines due to its huge flexibility.  The changes to the current implementation are minimal but greatly improve the usability of the voxeldata feature.

The basic header implemented is:

typedef struct Header_vb //Header could be extended here easily
int resolX,resolY,resolZ;
int frames;
} Header_vb;


The changes to the already implemented tools that make use of voxeldata are also minimal, they only need to store the header at the beginning and to take into account the size of it  (offset) to properly index the dataset, and nothing more!

I have reimplemented also the basic simulator to store the header (will not be compatible with previous builds).  So, now the basic structure of a Blender compatible Dataset is


the Data format is a Linear array of floats, where each element is adressed as before by
the formula:


the UI looks like this:


Fig. 1 – Automatic resolution  detection


Fig. 2 – Still frame selected

For those impatient to wait inclusion into the sim_physics branch, here is the “semi-manual” patch (done against Sim_physics rev18682)

Rectangular Datasets and Still Frame features

14 thoughts on “Rectangular Datasets and Still Frame features

  1. Dennis F. says:

    Yes … that sounds like much work.
    Will it be possible to use obstacles with your voxeldata-smoke-simulator-thing?

    Dennis F.


  2. Ruddy says:

    Hi Dennis, 🙂

    this new voxeldata won’t change the current smoke simulator behavior about obstacles, settings. It will only ease the importation process of the smoke.bin file (no need to enter the resolution anymore, automatic detection)
    It has been designed first for scientist who have specific datasets.
    Smoke simulator will take more time to be fully matured inside blender, we are waiting first for Daniel Genrich’s point of view about this, as he has experience with simulators (he has implemented the cloth simulator and has improved the fluid simulator), so his help would be invaluable for this project.


  3. Dennis F. says:

    Okay! Actually i try to get a NEAR-VOXEL-LOOK with point-density-textures and a particle systems. I love that high-detailed-smoke-turbolences.

    We´ll see how its going…


  4. David says:

    Thanks. I can’t wait for the simulator to be fully implemented in to blender. BTW where should I post error reports for the sim_physics branch? Here, on the download page, on, or all of them, just to be extra annoying? 🙂 JK. Some day I will learn more about the art of programing so that I can be more of a help than a nuisance. Thanks again for all your hard work.
    God Bless.


  5. the newest blender version from the sim-physics branch (19326) crashs always when I try to import voxeldata with the new voxel-format. has anyone similar problems?


  6. Leprax says:

    Hi all!!

    Martin i have the same problem, when I import a Voxel Data created from Smoke.c from this link , as soon as I press F12 to render, I get a Segment Violation crash

    May be we should try with the simulator from but I cant find the source code to build it in linux

    I do think is a problem with Voxel Data headers, but not sure…


  7. Leprax says:

    Well, if tried the sim from with wine from linux and i have the same problem

    As i have read in that entry, people are having same issues on windows build, so there seem to be a problem, may be a bug with current svn physics branch and voxel data rendering from simulators around here, but may be these sims are oldies as the documentation…

    Should we report this?

    PS. Sorry for my english, and many thanks to fasthary for bringing voxels to blender!!!


    1. srinivma says:

      I was getting the same crashing when trying to load any voxel data. I located the error to voxeldata.c, where there is a file-read on a null file pointer. Try this simple patch, it should work.

      Index: voxeldata.c
      — voxeldata.c (revision 20166)
      +++ voxeldata.c (working copy)
      @@ -355,14 +355,14 @@

      if (!vd) return;

      + if (!BLI_exists(vd->source_path)) return;
      + fp = fopen(vd->source_path,”rb”);
      + if (!fp) return;
      read_voxeldata_header(fp, vd);
      size = (vd->resolX)*(vd->resolY)*(vd->resolZ);
      vd->dataset = MEM_mallocN(sizeof(float)*size, “voxel dataset”);

      – if (!BLI_exists(vd->source_path)) return;
      – fp = fopen(vd->source_path,”rb”);
      – if (!fp) return;

      //here improve the dataset loading function for more dataset types
      if (vd->still) load_frame(fp, vd->dataset, size, vd->still_frame, sizeof(VoxelDataHeader));
      else load_frame(fp, vd->dataset, size, re->r.cfra, sizeof(VoxelDataHeader));


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.