This is a script for sketching arrays in Blender 2.5.
(The blue download button)
The ZIP file includes the script, a PDF file explaining how to use it, and a blend file with the default brush (spheres) and the array brush shown in the video. Also the matcap used for the GLSL material.
UPDATE (7-May-2010): A video-tutorial was kindly made by Dimetrii . The voice is in Russian, but it clearly demonstrates the features of this tool, and it has some subtitles in english. (Here is the discussion thread for the tutorial)
Note that the script is on an alpha stage. I've tested it with SVN revision 26022, and may probably need changes for future Blender releases. If you want to report bugs, you can post them in this thread.
Run first the script ArraySketch.py, and then ArraySketch_hotkeys.py to register the hotkeys.
IMPORTANT: always use the stroke tools when working with strokes. For instance to delete a stroke use the "Delete" button or HotKey of this script instead of just pressing Del key. The same for enter or exit "Stroke Edit mode".
Because they behave in a different way than the usual Delete and Edit mode.
A grease pencil video tutorial that may help get a grasp of the actual grease pencil features:
Want to thank Campbell Barton (ideasman_42) for suggesting using Python and for telling me how to extract points from grease pencil strokes.
And special thanks to Crouch for his 2.5 Python examples thread, and the people who posted code there. It's been a huge help. Very recommended thread for anyone interested in learning Python for Blender 2.5.
Some technical aspects for those who care:
Everything in the video was done in Blender, even the video editing, and the matcap for the GLSL materials.
This script uses actual Blender 2.5 features combined using Python. Essentially it takes advantage of the beautiful capabilities of the actual grease pencil, the speed and versatility of the Array modifier, together with Curve modifier, and all the curve editing goodnesses available, like curve radius control, tilt, etc.
This proves how a user with Python knowledge, but without deep math knowledge, can bring nice tools out of Blender 2.5 and its new Python capabilities.
The All quads meshing feature is a trick that works like this:
- Metaballs along the curves
- Convert them to mesh and use Decimate modifier to reduce polys quite a lot.
- Convert Tris to Quads feature from Blender (which leaves some tris)
- Add subdivision (which makes the trick for "All quads").
- And finally use Shrinkwrap modifier to get this new decimated/subdivided mesh to the surface of the original mesh obtained from the metaballs.
It's slow, it may take a few minutes depending on the complexity of the model. Always check the console to see the progress, and get an idea of how much it will take.
The slow down takes place mostly in the metaballs creation process. And then when the metaballs are converted to mesh. The decimation and Quads convertion is relatively quick.
The good thing is that as result you get a mesh with fairly uniform distribution of quads, and a number of them that benefits the speed of sculpting, since actual sculpting speed increase a lot when the base mesh has enough faces.
And at the same time I tried to balance the number of them enough to get a result that reflects what was sketched with the arrays strokes, and at the same time don't get too many of them.
Not sure what's the state of Genscher's Decimate modifier, but if it will be integrated into Blender it may give nicer results.
The meshing is done in 3 steps. This should be just one step in the future, but for some reason right now Blender doesn't do some steps all in one operator, so I had to divide things into more than one. Not sure if I'm doing something wrong.
You can change the material of the strokes by changing the material of the brush object before adding the stroke, or after adding the stroke by simply selecting that stroke and changing its material.
- You have to apply the scale and rotation of the main object before start adding strokes.
- Right now the brush object must be in the same layer as the main object.
- The metaballs convertion seems to get slower with each metaball created. This seems natural at first glance, because there are more metaballs. But after deleting those metaballs and doing a new meshing the conversion maintains its slowing down.
This is solved by saving the file before doing the meshing and opening it again. It's like something remains there in some place but don't know what or where. Maybe a Dev knows better what happens here.
I've been learning 2.5 API while doing this, so some things of the code may not have the best practices. For instance, at the begining I didn't know how to set custom properties, so the different elements are related by object-name conventions.
Don't be shy to criticize suggesting better code practices.
Well... hope you enjoy it.. I'm glad for the interest this script brought.