What’s up? It’s been awhile since I’ve visited the forums, but I’d like to announce the upcomming version of my grass generator! Here’s an image I created with my script in combination with the L-system tree generator by Armagan.
Grass stats:
281528 faces
took 55.57 seconds to generate
Subsurf level 1
Render stats:
1 spotlight with a 2560 kilobit shadow buffer
1 quadratic, spherical point light
52.81 seconds to render the scene
So the render took about 53 seconds… compare that to the hours it would take if those blades of grass were comprised of static particles! Also, the grass can receive and cast shadows!!! Since the grass is a mesh, IT’S ANIMATABLE! This version overcomes the vertex limit errors of previous grass/hair generators. You no longer have to split up the ground mesh! This can still run on multiple ground meshes at once as well!
Thanks very much for the great grass generator. I was allready working on a picture with grass made with the first generator in it but I will see if I can make it more realistic with the new script.
By the way, I’m missing the GUI of the old script. Will there be a GUI in the next release???
By the way, I’m missing the GUI of the old script. Will there be a GUI in the next release???
Sorry, but there isn’t a GUI right now… I’m working on integrating a wind script with the grass, and it would be extremely hard to make a GUI for a linked-script. Who knows if I’ll finish it though.
The picture I uploaded contains 281,528 faces, but I reduced it to 61,434 without degrading the quality. I just tweaked the segments(2), length(50), and density (40). Also made it look a little more random by increasing the gravity to 200. Shows that more is not always better.
doesnt work for me Python says no module named random
You NEED to download python 2.0.1 (http://www.python.org/2.0.1/)!!! Random is an external module that comes with Python 2.0.1.
Once you install it, you’ll have to set a reference to it in your Windows environment variables (not sure how you do it in Linux).
For windows 9x/ME:
In c:\ there should be a file named autoexec.bat
Right-click on it and choose edit
paste this line of code in:
SET PYTHONPATH = C:\PYTHON20;C:\PYTHON20\DLLS;C:\PYTHON20\LIB;C:\PYTHON20\LIB\LIB-TK
Save it and close, then double-click autoexec.bat
For windows NT/2000/XP:
Right click on My Computer and select properties
Under the Advanced tab, click “Environment Variables”
Under System variables, click New
Variable name is PYTHONPATH
Variable value is C:\PYTHON20;C:\PYTHON20\DLLS;C:\PYTHON20\LIB;C:\PYTHON20\LIB\LIB-TK
Try adding the line ‘import random’ on the line above ‘from random import random’
Then your going to get the error (very likely) ’ File “/usr/local/lib/python2.1/random.py”, line 143, in seed
import time
ImportError: No module named time’
Work around for that is at http://www.michaelv.f2s.com/blender.html look for ‘A fake time.py module to trick Pythons random() into working’ towards the bottom of the page. Put the script in your python dir. with the rest of the python scripts.
After that the script runs until this error message "RipSting’s Grass generator running…
Traceback (most recent call last):
File “Grass3”, line 121, in ?
AttributeError: mats"
The line reads “me.mats.append(matGrass)” is that a typo (mats) that is?
P.S. This is will only work on nix systems (I’m using OS X) (the work around for time.py that is)
I had tried to assign a grass material to the grass meshes as they were created, but I couldn’t get it to work reliably. I didn’t bother to take out the faulty code because it wasn’t generating any errors on my windows machine. But now I did and re-uploaded the .blend so you shouldn’t get that error.
Maybe you could use the Blender.Window.draw_progressbar function to show the progress of the script.
You can do a GUI for a runtime script if you use an external runtime file or an external data file for the settings. If you want help with that, just tell me.
That works! Nice script, it may have worked on a linux box, I think OS X is a little picky some times. :-?
I don’t have to add ‘import random’ any more, it works as is.
Agh! How do I get it to work? I have Python 2.0.1 installed (or at least I THINK I have… I unpacked it, used ./configure and ./make ), but when I press alt-p, nothing happens (yes, I use the grass3.blend file)…
Did you get any error message in the console? The script takes a while to finish to run, so it might seems like Blender has crashed, but it’s still running.
Did you set the path to the python /lib in the top header (in Blender)?
Pull the top of the top 3D window down and add the python path (full path), it’s between the Auto save button and the Font button on the left side.