Participating Media / SMOKE

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Akos
Posts: 0
Joined: Wed Jul 10, 2013 4:08 pm

Participating Media / SMOKE

Post by Akos » Fri Aug 23, 2013 5:30 pm

Hi everyone,

I want to make an exporter that takes the interior of the Domain Box of the smoke scene. (the Domain Box should be divided into smaller boxes and each of them should have a density value of [0-1] ). In the output file ( .vol ) i want to have these values, so that i can recreate the smoke.

I'm not sure that this is possible using only python (I hope it is). I don't know how could i get the density values . I have seen that here exists something called density :
Smoke density
float array of 32 items in [-inf, inf], default (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), (readonly)
[ And why it is saying that is has only 32 items ? ]

http://www.blender.org/documentation/bl ... ight=smoke

Can somebody show me how can i get access to the volume data ?

With respect ,
A.

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Fri Aug 23, 2013 6:44 pm

Disclaimer: I am completely unfamiliar with the Smoke internals, but....

From a quick peek at the API docs, it looks like the voxel data is written to a file.

Since the smoke density array only has 32 elements it probably is not the entire set of voxels unless you are doing verrrrrrry tiny domains ( a 4x4x4 cube has 64 elements)

I suspect the voxel data uses an index into the array for the density at a particular voxel.

Akos
Posts: 0
Joined: Wed Jul 10, 2013 4:08 pm

Post by Akos » Mon Aug 26, 2013 5:51 pm

Still i can't find it. :( All I'm finding in the net is how to create a voxel data, but noting on were is it stored in blender, or how could i get it/export it.

If somebody could help me out I would be really grateful,
A.

Akos
Posts: 0
Joined: Wed Jul 10, 2013 4:08 pm

Post by Akos » Fri Aug 30, 2013 9:36 am

I find it 8)

If someone else is looking for it, then you can find it in :

Code: Select all

bpy.data.object['CubeDomain'].modifiers['Smoke'].domain_settings.density
A.

Post Reply