Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Cloud Generator Script for Blender 2.5

64

A cloud generator script has recently been completed to aid in the creation of clouds in Blender 2.5.  It uses boxes to allow an artist to individually sculpt each cloud to the size and shape of the aritists liking.  I cloud can be created with all materials added in literally two mouse clicks.

Nick Keeline writes:

Three weeks ago I had never seen a line of python code in my life and I had this idea that I wanted to make a cloud sculpting script that would take all of the time out of learning how to set up volumetrics for new users.  It really is a testament to how flexible and useful the new 2.5 python api is to learn and implement.

The following is a quick tutorial I did on how to use it....

You can download the script from BlenderArtists. If you use the script or have any clouds to show, please post them on the thread!

This Script only works on SVN 28015 or newer and will problably break on newer releases as the python api fluctuates.  But it works for now so have fun!

64 Comments

  1. Wow, this guy has done some impressive work. Its worth heading over to the blenderartists.org thread and checking out bensyversion's render on Page 2. It blew me away!

    This really does speak volumes (pun intended - I guess) about the new python API for Blender! =)

  2. A superb script, looking at it now, not bad at all and I'm very impressed by some of the results.

    The fluctuation of the API (and various other elements in the svn) is both cause for great excitement and slight (certainly not grudged because of the rate of progress though) frustration.

    But then when you consider the power and accessiblity blender's going to have when it's completed and out of alpha/beta! wow, just blows my mind everytime.

  3. Whoa!! I'm as happy as the next guy to see a good looking new script, and whiole the script does show promise, the picture attached to this story most certainly did NOT come from the script....
    The artist (Bensyverson) explains his work method as follows:

    1. Sculpt the basic cloud shape
    2. Apply a particle system with 10000 particles, turn off Gravity and Normal Emission, change start and end to frame 1
    3. Create a new "Clouds" Texture (Depth 3, Noise: Hard, Size varies with size of the mesh, I used 4.0)
    4. Use the texture in a Texture Force Field
    5. Animate the particle system. It should blow apart completely within about 5 frames. Usually frame 2 is pretty good. You want to keep the shape of your sculpt, while letting the edges get blown out a little.
    6. Export as XYZ, re-import as XYZ to "freeze" the particle vertexes on the desired frame
    I did that about 12 times, building up a library of individual clouds. Then I assembled them into a cloudscape.
    Volume material settings: Density scale: 0.5, Scattering: 3.2, Emission: 0.1 (bluish). Point Density texture settings: mostly default, but remember to set Coordinates to Global. Turbulence: Voroni F2-F1, Depth: 3.
    Lighting: One reddish sun lamp (brightness 3.3) and one bluish hemi lamp (brightness 2.0)

    ....so not exactly the 2-click cloudscape.
    The picture should be changed to show one of the REAL script outputs...

  4. HELP!! how do I paste the script into blender, I selected and copied the text from the website then I opened up the blender text file and used the paste button, but only the first 4 lines of the script copied over. Can anybody help?

  5. Congratulations, Nick. This is not only great for a first python project, but great in general. You did choose a really useful thing to create. Thank you :)

  6. Blending BriGuy on

    I would like to suggest that a screen capture from the tutorial be used to supplement the image at the top of the page, just for truth-in-advertising. As UglyMike said, there is a big difference between the two-click picture and the extra work that Bensyverson put in, so we really need the actual render from the tutorial up there as well.

  7. Thanks for the praise guys, you are right about the truth in advertising with Ben Syverson, it was his results that spurred me to make the script and I used his scripts as inspiration for mine... so THANK YOU BEN. Most of the image above is in the lighting and tweaking the settings so there is no reason you cannot create a render like his with the script so it's not entirely false advertising ;) it just takes a lot more tweaking than what the script does for you.

    To use the script copy and paste the text from paste all into a text.py file and place it in the addons directory and you should be good to go! Enjoy!

    Here is one I did the other night with minor tweaks with the script:

    http://blenderartists.org/forum/attachment.php?attachmentid=103461&d=1271303681

  8. It already is an add-on, it's just doesn't come with the build.

    I've noticed two things:

    1. DeGenerate should be a separate tool so that when you search for it in the tools, it can be found, instead of having to understand that Generate Cloud applied to a cloud object will degenerate it.

    2. When I load blender, even though I've saved my user preferences with the Cloud panel existing in the toolbar, the cloud panel is gone, and in order to get it back, I have to go back into the user preferences, and toggle the add-on on and off. I am using the correct build for the script I installed.

    Also, if you could add presets to the generated materials (smog, smoke, cloud), and then generate with different densities accordingly (smog would be thin, smoke would be fine, and clouds would be...clouds), that would be a great improvement.

    And what purpose does the Cloud_Mesh have?

    Great Job. Helps A LOT!

  9. The cloud mesh is the boundary for the particle generation and is a construct of the geometry boxes or otherwise you started with. I left it in the structure of the cloud because it is useful for the object reference when modifiers are used. Try a displace texture modifier on the points mesh and use the cloud mesh as an object reference and you'll see what I mean. Also, you can quickly uses boxes to model something and the cloud mesh may be useful for something other than clouds, the beginnings of sculpting etc, it's a very fast way to model.

    There is a button in the lower left of the user prefs that permanently applies the addons.

    I debated the usefulness of degenerate and left it in.

    I would love to put in different types of clouds per your suggestion, that is something I will look into as I have time.

    Thanks for looking in to it!

  10. Great Script!!!!

    I'm new to Blender, and I'm not familiar with some fundamental features. I watched your how-to video, and I can't figure out how you manipulated regions of points. In Edit Mode, I can select points individually, but how do you effect a range of influence?

    Cheers!

  11. I answered my own question. I learned it was proportional editing.

    So now that I've played around a bit with the script. It would be cool if you could use forces to animate the point cloud. This would help with better realism.

    -Sterling

  12. @NRK
    I was saving my user preferences. It still didn't work.

    Anyway, I see what you mean about the cloud mesh. However, your idea needs some cleaning up in my opinion.
    Here's what I would do.
    1. Generate the clouds as you do.
    2. Instead of using a bounding box as the parent, use the cloud mesh as a parent for all cloud objects.
    3. When you're done generating, hide the mesh objects used to generate the cloud, but parent them to the cloud mesh.
    4. Store a property in the cloud mesh that refers to the cloud_point object for that cloud.
    5. Create a re-generate button, so you can use the sculpt tools to model the cloud_mesh object (like for textures or more editing), and then re-generate the cloud from that cloud_mesh.
    6. The de-generate button would delete the cloud mesh, leave the cloud points, and un-hide the sculpting boxes.

    If you could do something like that, it would be awesome, because then you could inflate parts of the cloud, smooth others, and give other parts a texture. But it's still usable as it is (it's really nice), so I have no complaints, just ideas.

    Thanks.

  13. I LOVE Suggestions, thank you for putting so much thought into it. I actually prefer the bounding box as parent because that IS the cloud (from blender's point of view when it's rendering) and when you do a lot of clouds you have to make sure they don't intersect or you get rendering anomalys. Also, the bounding box is the easiest thing in the could to select since they're all muddled to gether. I do like the idea of totally hiding the boxes instead of leaving them wireframe. As for sculpting the cloud I think you would be better off tailoring your cloud by making vertex groups and assigning varying point density textures to make different parts of the cloud the way you want them and you can apply modifiers to the point mesh as you wish to make animations or even shape keys if you really want to tailor the look. Originally this script left particle systems instead of vertex objects, but there is no way to really control particle systems and freeze them in place reliably, nothing against them, but they're really not tailored for what you need when you're making a cloud right now. Sorry for the long response, if you can't tell I've been living and breathing this a lot lately.

  14. i notice that in Ben Syverson's clouds there is a finer grain of whispiness? whereas the cloud generator makes blobby looking clouds. Do I need to make smaller boxes at the start or is it a matter of altering the textures. I tried but still I get a billowing effect, not a ragged look. Thanks again its a great tool NRK.

  15. I am revising the cloud generator to include the voronai f1 turbulence to the point denstiy volume, but for now just enable it and set Depth to 3 after running the generator

  16. NRK, please can you make the script into a .py for download- because I am not able copy and paste into the blender text editor only the first 4 lines are copied. Thankyou

  17. Blender artists doesn't let you post .py code so I used pasteall.

    I just tried it, if you select edit code it brings the code up in a window that will copy and paste into blender. I just updated the cloud generator and fixed a bunch of bugs and made the clouds look better... here's the link:

    http://www.pasteall.org/12493/python

  18. NRK,

    Great improvement, now if we could animate the points with a force, this would be stunning in an animation.

    Why is it that when two clouds intersect, they render weird?

    -Sterling

  19. Use a modifier or shape keys to animate the points. Someday this script will use particles instead of verts, but for now verts work better for cloiuds. Also apply a texture to the cloud textures and use a driver on the coordinates to animate the texture, that will give you a pretty cool look. The intersection issue is a part of blender and is either a limitation or a bug depending on how you look at it, can't help you there.

  20. i had error messages when i tried to run the script...
    i will have to wait until blender 2.50 is production release
    it's nonetheless a very good script though

  21. error message:
    python script fail,look in the consol for now
    location::-1
    indentationerror:unexpected indent

  22. Don't have to wait that long.... the script is now part of blender, just wait a few days and go to graphicall get latest blender and it will be in addons dir by default. If you want to use it right now you MUST have the latest version of blender from graphicall.

  23. i am sorry but probably made some mistake while copying and pasting the script into a text editor
    i have copied lines numbers that were not part of the script
    and did not notice your instructions about addons activation too
    i am going to try it and see if it works...
    it works as far as i have tried it...
    thanks pal...

  24. NRK thankyou I have now saved it as a .py I tried to press ALT P and it failed, I searched for the addons directory in blender 2.5 files and I am not able to locate it.
    Please can you tell me how to find the addons directory - and then how do I get the script to work? Thankyou for you help up to now and sorry to trouble you again

  25. you must download and unpack the latest 2.5 from graphicall,
    go to my link and click edit, then go into the field and drag select all text and select all
    hit cntrl c and in blender text editor hit cntrl p
    then inside the dir you unpaced is a .blender/scripts/addons dir save the text file as a .py from blender
    then follow the tutorial.

  26. Blender Foundation would be NUTS not to implement this script as Modifier in the next release!

    This is simply AWESOME!

    I was watching the video and it got me thinking.
    How cool would it be if the artist could animate the boxes in order to animate the look/size/feel of the cloud?

    Blender is giving me issues at the moment so i can't test this idea, but could someone else do it for me?

    Try animating the boxes (50 frames or so) and then apply the Cloud Script to them. Will this animate the cloud? Or does converting them to a cloud block the boxes' animations?
    -----------------
    EDIT!

    Animating the blocks does NOT animate the cloud.
    You must use shape Modifiers or empties to animate the shape of the cloud.

  27. Great idea, but it would require more coding. You would have to apply the script at each frame since after the script is applied it is no longer linked to the boxes other than retaining the boxes for possible reuse. The boxes are still there but there is no dynamic link between the particles and the boxes. For what you want it would really be best if you did have a modifier

  28. ian 3d
    you will have to activate the "show-hidden-folder" option
    then go back to blender folder and search for the script folder
    when you find it copy and paste py scripts in it
    then go to user preferences once you launched blender
    you will find addons there
    you then add the script by showing path to blender then activate it
    and once again in the 3d view...it will normally appear in the tool shelf
    for me now:
    i use ubuntu and there seems to be a problem with viméo...vidéos..especially when it comes to sound:i hear nothing
    is there any other tutorial...about the script???

  29. NRK,

    Can you explain the limitations of the script?

    I made a bunch of boxes and had them all selected, but when I clicked on the cloud button, it made a point cloud using just one box.

    -Sterling

  30. There is no sound in the video, I usually do sound but for some reason didn't do this time.

    As for why it didn't work for you the time you selected multiple boxes I have not seen that. I have accidentally forgotten to select some of the boxes and had that happen, or if you happen to select a lamp in with the boxes who knows what will happen. I usually shift right click each on in turn although I've used box select as well with good success.

  31. Ok I just downloaded 28269 from graphicall and it has the script in it! Unfortunately it doesn't have my latest fixes/aesthetics in it, but it's there! Hooray!

  32. I hope, this generator becomes part of the Blender package. I believe, it would be used by loads of Blender artists.

  33. NRK,

    First, congrats on having your script included.

    Second, I manually selected all of the boxes in my scene and hit "Generate Cloud" but it still only makes a point cloud for one box, and it's always the same box, no matter what order I select the boxes in.

    After I deleted the box that it kept using as the only mesh for point cloud generation, it started working for the entire scene. My guess is that the issue has something to do with the placement of the offending box in relation to others around it.

    I'd like to send you the file, if you are interested in looking at it. The test animation (Link in above post) was done with some, not all, of the boxes in this scene.

    Cheers,

    Sterling

  34. This is amazing. It is important enough to become integral part of Blender. It solves an old Blender problem and it shouldnt depend on the Blender or Phyton version. Thank you for this gift!!!

  35. as of 28245 it is in blender by default although I have a newer better version on my site that will eventually make it into blender as well.

  36. Son of a...

    Nah just kidding, it's a great script. I just wish it was around before I released my volumetric clouds tutorial about 4 weeks ago! :P

  37. I still think my script makes making clouds easier, but full tuts on how to do it by hand are important to make users able to tweak what they need and understand what they have.

  38. Everyone is talking about boxes for this script.
    i feel it needs to be noted that you don't have to use boxes. Any mesh will work with this script. Even Text works. :)

  39. This is really close to perfect.. I loved it.. The image put up to show this blog post is i guess from a music video done by some guy i dont remember his name.. anyway.. an addition to this would make it just perfect.. like that image, if there were other sky images which would represent presets including lighting setups, cloud groups and appropriate backgrounds so anyone could choose one of those presets to start with and change it to their liking.. this is something i saw in cinema 4d but this compared to it aahaha cinema 4d would be way behind if what i said is implemented into blender.. anyway just an idea.. i am not too fanatic about it :) i love blender.. and i love 3d.. thanx for this great script..

  40. hedehodo, Thanks for the suggestion, it's got me thinking what to add, I had not considered lighting. I will give it some thought.

  41. cant edit my post, just played around a bit, but what i can say by now is that the script might have changed things it shouldnt. for instance materials are flat and dark now, some objects dont receive light and shadiw even if they are placed directly in front of the sun. iam unhappy now ^^

  42. please, if anyone knows errors escpecially the author of this script, tell me!! ^^

    does it change anything in the outputpipeline? materials etc i just opened a backup file where everything is setted up the exact same way it was saved right before i tested the script, and now nearly every material on about 30objects. all in the same layer with the sun do not receive light or shadow.

    i just made screenshots of the button windows and there is no difference in both files???
    ther must be something changed, i cant see or edit by hand.

    please help me and i promise i will never ever install a script thats not packed with blender ...

  43. The clouds by this generator are flat and if I increase the density f the material to get a lttle bit of volume the rendered shous the bounding cube as a nice looking 3d cloud

  44. Rombout Versluijs on

    I know its a while back, but the link to BA page is dead. Probably wrong transfer there.

    Does some one know a working link. I tried a search but i get endless result

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement

×