Page 1 of 2 12 LastLast
Results 1 to 20 of 28
  1. #1

    [Addon,OBSOLETE]Smoke2Cycles - 1-click solution for volumetric fire/smoke in cycles

    THIS ADDON IS OBSOLETE BY NOW. THE NEWEST BLENDER BUILDS SUPPORT VOXEL TEXTURE WITHOUT THIS WORKAROUND. However, you might still use this addon if you are stuck for some reason at the official 2.70 version and want to render smoke in cycles or as a code reference.

    A while ago I created a small OSL-Script/Python combination in order to enable the possibility to transfer smoke simulations into a volumetric density node for Blender 2.69.x and 2.70 for which smoke/fire is not officially suported. Yet, luxblend25 was required (the exporter for luxrender) and you needed to do the setup by hand in a very unintuitive way.

    So I put a lot of work into presenting you this addon: Smoke2Cycles (v 0.1)
    UPDATE it's v 0.2 now
    UPDATE even newer version 0.3

    It offers a one-click solution to transfer your existing smoke simulation into cycles.

    Key features

    • Support for high-res / adaptive domain
    • Smoke and fire support
    • Automatic material creation
    • Automatic osl-script insert
    • Automatic key frame creation to direct animations
    • Materials can be fully tuned and still keyframes will be updated
    • Automatic generation of a "domain" cube object for cycles in a separate layer (resizes to adaptive domain)
    • No more dependence on luxblend
    • The original .PNG solution lead to serious interpolation issues and is dropped for .exr textures
    • Exporter rewritten from scratch

    • CPU only (even if volumetrics would work, OSL nodes are required)
    • No smoke color from simulation yet
    • Liblzo and liblzma are required (they are packed for Win32/Win64 and MacOS64 (untested) ). If you have a linux box an would provide a compiled version for me I will happily include them.


    1. Download zip from attachement.
    2. Open user preferences (ctrl + alt + U) -> Addons
    3. Enable the checkbox next to Smoke2Cycles.



    • Addon can be found in 3D view under tools (T) -> Physics -> Smoke2Cycles
    • Setup smoke simulation in Bender internal. There is no need to assign smoke textures or material.
    • Save the file and bake the smoke simulation.
    • Select the domain object.
    • Settings - Frames [1]: Export for current frame or a range of frames
    • Settings - Texture [2]: Select a base file name for the exported .exr textures which contain the voxel data from the smoke simulation. A frame number and extension is automatically added.
    • Settings - Material [3]: Choose the material you want to generate. Fire just uses emission and is much faster than smoke or smoke + fire.
    • Settings - Domain [4]: A "domain" cube for cycles with the size of the adaptive domain is created and the material is attached. You can in which layer it will be generated.
    • Settings - Linked Cycles Domain [5]: After the first generation of the cycles cube/material and textures you can modify the linked domain settings instead of creating new stuff each time.
    • Settings - Smoke2Cycles [6]: Start the conversion. Depending on the domain resolution and number of selected frames this step will take some time.


    Generated node setup

    • The nodes can be tuned and modified. The relevant nodes are generated with specific names in order to be identified for updates.
    • You can even delete nodes which automatically update. Their possible changes are simply ignored.


    • Fire all yellow: Make sure you have OSL enabled in rendersettings.
    • Solid box of smoke: Make sure you have OSL enabled in rendersettings.
    • Errors on execution: Specified frame not present in simulation?
    • Errors on execution: Linux are the required compression libraries installed (liblzo, liblzma)
    • I found a bug / want to contribute: I would be very happy if you report it:

    Happy blending!
    Attached Files Attached Files
    Last edited by HiPhiSch; 03-Apr-14 at 01:08. Reason: v_0_2, v_0_3

  2. #2
    Join Date
    Jan 2012
    Looks really nice I hope to get some time to try it. Thanks a lot for sharing.

  3. #3
    @matali: Thx!

    I found a really stupid bug which was introduced last minute. For the material assignment the active object is no longer the "pseudo domain" in cycles but the real domain object. This leads to exceptions and probably renders the first version mostly useless.

    Ok, so here is the update:
    Version 0.2 (download -> see updated first post)
    • Bugfix: material assignment
    • Operator is now modal, so for each frame the interface will update
    • You get a nice progressbar cursor (just like for the baking)
    • A new checkbox to activate/deactivate the creation of keyframes
    • Specific errors will be presented as warnings, e. g. if not baked first

  4. #4
    I tried it with smoke only and it looks like it's off to a decent start! however, tried with fire+smoke and got lots of black/blue parts in the middle of the fire. it seems like something get's weird when it's adding the fire to the smoke, viewed separately the fire and smoke seems like what I'd expect. (Camera is outside volume, it's just default cube scaled 0,2 then 3 on y axis and a quicksmoke but changed to fire and smoke, simulated . using windows 64 exp vs 2013 build 6a2c467 (buildbot latest build) )

  5. #5
    Thanks for the interest. I see the same effects here. I guess the effect stems from the fact that you have at the very same volume voxel a scattering and an emission effect. The emitted value is somehow directly scattered and if you scatter red light away you expect something blue. So probably there is also some part of the calculation missing in the shader - i guess because the light beam never enters the voxel. A partial workaround is to increase the anisotropy value (currently defaults to 0.85 for exactly this reason) to even higher values. This will make the light preferably scattered in forward direction -> less blue tinting. It helps if you add more illumination from the outside and if you increase the divisions.

    If I can gather together more time for testing and coding I want to test if a reduction of smoke density for areas with fire will lead to a reduction of this effect without effecting the original simulation outcome to much.

  6. #6
    Member MatiasWeyerstal's Avatar
    Join Date
    May 2012
    Tucuman, Argentina
    This works very good man! Thank you!

  7. #7
    I get more of these blue discolorations the brighter my brackground is. Weird. I don't get them if I clamp the density to the scatter node.

    Could it be a bug in cycles? If I skip your scripts and simulate it using quadratic sphere gradient textures piped to colorramps black-White (White earlier in the smoke part) and multiplies the density by 10 and 5 as you do and then add them together I get the same behaviour, and again if I clamp the "smoke" part the blue colors disappear. Is this really the expected behaviour of having density over 1? You are obviously more into fluids and volume rendering than I am, perhaps you could figure out whether it's a bug in cycles or if this is expected behaviour. As you say only the emit and the scatter nodes are needed to get the the complement color.

  8. #8

    Version 0.3.0


    Thanks for the interest. I updated the addon once more.


    As you can see from the screenshot the node setup for smoke + flames got a bit more complicated by now. Basically I changed the following. If smoke and fire are present in the same part of the volume there was the effect (as also observed by tobbew) that the scattering turned blueish. I am not entirely sure but at the moment I think it's likely that this is even a bug within the cycles kernel. I worked around it in the following way: If both smoke and fire are present in the same part of the volume the scattering part will be replaced by a compensating absorption part instead. This helps a lot with the render outcome.

    Furthermore a few minor changes:

    • The fire ignition and max temperature were used to determine the color of the fire emission in versions before v 0.3.0. Now the emission color corresponds to a fixed temperature range. This range is in common situations closer to what you see in the 3D preview. Feel free to tune the temperature in the corresponding node in the material for other outcomes.
    • The anisotropy of the smoke volume scattering node is set back to zero. The increased value in the last release was mainly thought to compensate the strange blueish scattering.
    • Overall some fine tuning of parameters.
    • One more output from the main OSL node SmokeXorFire which is 1.0 in case that either smoke or fire is present and zero if both are present.
    Attached Files Attached Files

  9. #9

    i tried all the versions and all i got is an orange volume on layer 2, see below:

    am i doing something wrong, or is it a bug? thanks.

  10. #10
    Originally Posted by HiPhiSch View Post
    • Fire all yellow: Make sure you have OSL enabled in rendersettings.
    • Solid box of smoke: Make sure you have OSL enabled in rendersettings.
    • Errors on execution: Specified frame not present in simulation?
    • Errors on execution: Linux are the required compression libraries installed (liblzo, liblzma)
    • I found a bug / want to contribute: I would be very happy if you report it:
    I guess everything is fine but you did not enable open scripting language from the render settings panel.

    Good luck!

  11. #11
    Good luck!
    Fire all yellow: Make sure you have OSL enabled in rendersettings.
    i red it and though it meant that i should have an osl enabled build, and didn't notice the enable osl checkbox, sorry.
    thanks for the help

    now the built i got apparently has an osl crash on rendering, after i fix that i'll retest -iAw-

  12. #12
    i found it is because of the add-on, here is the exception:
    Unhandled exception at 0x00007FFD3D6C2E02 (ntdll.dll) in blender.exe: 0xC0000005: Access violation writing location 0x0000000000000024.
    osl work okay without the included dll's, i think they are not compatible with mingw64 builds, i use windows 8.1.

  13. #13
    Sorry to hear about this!

    That's really strange. The dlls are only used from within python to decompress the point cache which happens if you generate the texture. They are not magically linked into the C-Portion of blender and I cannot think of a way how they disturb OSL. If you did not push the Smoke2Cycles button once since the last start of blender they are not even loaded. I rather think it's an osl bug in the MingW64 build. The access violation does not tell much except for the fact that something is trying to access an object/structure/array which was not created before so that the pointer still is at null.

    Could you try if the attached blend file crashes if you enable osl in your build, too? - It's just a minimum osl snippet trying to load a pixel from the center of a texture-file which outputs the pixel.

    You could also just go for a buildbot build: I commonly use the newer VS 2013 experimental ones for Win64.
    Attached Files Attached Files

  14. #14
    sorry my build earlier was vs2012 not mingw64, and i figured out the problem, it was because of stripping the blender.exe after i built it (which i always do with no problems), sorry again for troubling you.

    i tried the script and it working, and it's awesome.

  15. #15

  16. #16
    To make it work on Ubuntu 13.10 64 bit I installed liblzma5 and liblzo2-2 from the Software Center, then I edited lines 70-79 in
    search_paths = {
    "LZO": {
    "mac" : [ [], "liblzo2.dylib" ],
    "win" : [ ["lzo.dll"], "lzo.dll" ],
    "linux" : [ ["/usr/lib/", "/lib/x86_64-linux-gnu/"], "" ] },
    "LZMA": {
    "mac" : [ [], "iblzmadec.dylib" ],
    "win" : [ ["lzma.dll"], "lzma.dll" ],
    "linux" : [ ["/usr/lib/", "/lib/x86_64-linux-gnu/"], "" ] }
    Change x86_64-linux-gnu with i386-linux-gnu on 32-bit systems.

    If you want to download the built libraries, you can download them here:

    and extract using 7-Zip.

  17. #17
    Member arod0890's Avatar
    Join Date
    Feb 2014
    Fort Knox, KY USA
    Can anyone tell me why this is happening? I thought I had done everything correctly but I can't seem to get it to work, or find what I did wrong. I've tried starting over a few times. I noticed it didn't create all the nodes like it was supposed to.

  18. #18
    Originally Posted by arod0890 View Post
    Can anyone tell me why this is happening?
    You need a newer version of blender. Official 2.69 does not support volumes yet. Try or graphicall builds.

    THX for the link to the binaries and Ubuntu infos. I will put it into a minor update soon...
    Last edited by HiPhiSch; 05-Mar-14 at 17:01. Reason: stupid android auto correction typos removed

  19. #19
    Member arod0890's Avatar
    Join Date
    Feb 2014
    Fort Knox, KY USA
    Ah. Thanks!

  20. #20
    i make a little tutorial in spanish if let me the autor in spanish, but watching you can make also.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts