Page MenuHome

openvdb-file with colored smoke
Closed, InvalidPublic


I am trying to generate an openvdb file with colored smoke (outside of blender).
And then read this into blender using smoke import/export.
I was able to generate smoke. But unable to read colored smoke.
So my question is: which values have to be exported to the openvdb file for smoke to be colored ?

these are the values i currently export. All filled with pseudo-values.
I Assumed it would be sufficient to write the color value.
But this did not result in colored smoke in blender.
What am I missing ?

	OpenVDBWriter_add_meta_int(writer, "blender/smoke/active_fields", 9);
	OpenVDBWriter_add_meta_v3_int(writer, "blender/smoke/resolution", res);
	OpenVDBWriter_add_meta_v3_int(writer, "blender/smoke/min_resolution", min_res);
	OpenVDBWriter_add_meta_v3_int(writer, "blender/smoke/max_resolution", max_res);
	OpenVDBWriter_add_meta_v3_int(writer, "blender/smoke/base_resolution", base_res);
	OpenVDBWriter_add_meta_v3(writer, "blender/smoke/min_bbox", min_bbox);
	OpenVDBWriter_add_meta_v3(writer, "blender/smoke/max_bbox", max_bbox);
	OpenVDBWriter_add_meta_v3(writer, "blender/smoke/dp0", dp0);
	OpenVDBWriter_add_meta_v3_int(writer, "blender/smoke/shift", shift);
	OpenVDBWriter_add_meta_v3(writer, "blender/smoke/obj_shift_f", shift_f);
	OpenVDBWriter_add_meta_v3(writer, "blender/smoke/active_color", active_color);
	OpenVDBWriter_add_meta_mat4(writer, "blender/smoke/obmat", obmat);
	OpenVDBWriter_add_meta_int(writer, "blender/smoke/fluid_fields", 1);//heat
	OpenVDBWriter_add_meta_fl(writer, "blender/smoke/dx", 0.0312500000 / 2);
	OpenVDBWriter_add_meta_fl(writer, "blender/smoke/dt", 0.100000001 / 2);
	density_grid = OpenVDB_export_grid_fl(writer, "density", dens, res, fluidmat, NULL);
	OpenVDB_export_grid_vec(writer, "color", r, g, b, res, fluidmat, VEC_INVARIANT, true, density_grid);



Event Timeline

Sergey Sharybin (sergey) lowered the priority of this task from Needs Triage by Developer to Normal.Oct 25 2016, 12:15 PM

@John The John (rueckwerts), this is always a very good idea to attach small files which demonstrates the exact issue.

@Kévin Dietrich (kevindietrich), is this information enough to troubleshoot something?

Whilst reading files written by other software should be possible, as long as the other software exports metadatas which would make sense in Blender, reading such files is not officially supported since that to properly support external .vdb files we would need a more open minded solver, or possibly even some volume primitive. Therefore I'm archiving this report.

@John The John (rueckwerts), looking at the metadatas, blender/smoke/fluid_fields is not set to also have color fields. It is a bit field with the following values:

value field
1 heat
2 fire
4 colors
8 color set in the UI

you can add those values to tell what fields are in the file; so if you have fire and colors you need to set it to a value of 6.

blender/smoke/active_fields works in the same way.