How to create batch scripts?

I am not a programmer but I think it’s usefull for everybody to know how to create a script that executes a sequence of operations in Blender without going through all the buttons :slight_smile:
An example
Sometimes when modeling you have to do a repetetive actions that may take a long time
(see this thread)
So is it possible to do this with python script:

  1. Set selected curve to Bezier type
  2. Set all control points to Automatic
  3. Bevel that curve with defined curve object

And some advices in general?

Thanks!

Hi

I made / mod a batch AC3D export script:
http://warezhouze.1g.fi/Here/Blender3d/AH_scripts/AH2_Batch_Export_sample.blend

I did use it for the Aces High 2 scene object creation. Scene objects in sample file are made by HitechCreations Ltd.

Thanks for replying Xjazz!
Unfortunately your script is far from what I am looking for.
It should be object editing script - modifying object properties in the same manner as with the use of the Blender interface.
And of course much smaller - a few lines probably?
Maybe batch word is inappropriate expression for what i am looking for, although this definition is pretty close to what I mean:
“Unit operation where one cycle of feed stock preparation, cooking, fermentation and distillation is completed before the next cycle is started.”
… just replace the bolder text with some Blender editing operations.

I tought that’s an eazy task for Python warriors :smiley:

Hi Syziph,
you can probably modify this script I wrote:
http://blender.formworks.co.nz/?p=4
its a script to iterate over selected items and modify them in some way.
It currently allows for setting “Autosmooth” on or off, can “Set Smooth” or “Set Solid” on all faces, apply a Material.
I havnt tried it on a recent release of blender but it should work or at least see how I did it.
lobo_nz

Hey lobo_nz! That’s a very nice script!
Setting smooth or solid can be applied on all selected meshes at once, without using the script.
But asigning one material to all selected objects is very handy!
Thanks for the help!
I will look at the script to see how it is organized.
The problem is that I don’t know how to make the script recognize Curve objects in order to apply the available methods for that object type. I read the the Python documentation but it’s still unclear for me how to use the objects and methods (I have little experience from JavaScript).
Well I can print the object’s name, the rest is bunch of errors :smiley: