[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18530] trunk/blender/release/scripts/ scripttemplate_background_job.py: have had few requests to use blender for performing background tasks

Campbell Barton ideasman42 at gmail.com
Fri Jan 16 12:02:28 CET 2009


These have a bit in common, but its not a script template and its in french.

For this, adding text is just an example of a generated scene, it
could just as well be an array of cubes or a teapot too.

Using argv directly is ok for a few args, but when you want to add
many arguments in arbitrary order, its better to use pythons optparse
module, since it also deals with converting int/string/bool/filename
args for you and makes --help text from your args.

I noticed in your example there is no "--" arg, Its a good idea to add
this so blender will ignore all args after it and python can use
those.
Otherwise you cant be sure a future version of blender might use the arguments.

On Fri, Jan 16, 2009 at 1:53 AM,  <jmsoler at free.fr> wrote:
> Selon Campbell Barton <ideasman42 at gmail.com>:
>
>> Revision: 18530
>>
>>
>> -----------
>> have had few requests to use blender for performing background tasks
>> - visualizing data, rendering scenes automatically and character rendering on
>> a server.
>>
>> This example script shows how you can run blender in background mode, parse
>> arguments from the command line to generate a simple scene and render/save
>> it.
>>
>
> I already see something like that on the web a bit shorter and largely  more
> detailled with intelligible explantions but reserved to french readers:
> http://jmsoler.free.fr/didacticiel/blender/tutor/py_OBtext_COMligne.htm
>
> jms
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list