Autoexecuting a script and rendering a scene ...

Hi all

I’d like to know if there is a way to have a python script automatically executed when blender is launched.

Here is the process that I’d like to have :

  1. Launching Blender.
  2. Opening a file with all the 3D objects.
  3. Using Python, reading a template that tells what objects are needed and where they are needed.
  4. Using Python, putting everything in the right place.
  5. Rendering

Do you think it is doable ?

I think that if i can automatically execute a script once blender is launched and if I can render the scene from Python, it schould work.

Any hint ?

I think (but not 100%) that scripts linked to “frame change” will execute when you open the file.

Not sure if you can kick off a render from inside python though.

Just to satisfy my curiosity, what are you trying to do?

Thx for yhe answer :slight_smile:

I’m trying to generate a picture from a text. (natural language processing prject)

Anyway, I’ve just started to use Blender and I don’t know how to link a script :stuck_out_tongue:

If I can’t render the scene directly, is it possible to save the scene, close blender and then open it again with the -a option ?

I found how to link a script :slight_smile:

Everything is working now : I launch Blender with the -b and the -f 1 options and the script linked to the frame change event is executed before the render


Nice one! But can you tell me what the frame change thing is all about/what it is?



I’ve just started with Blender but here is what I understod from what I read:

A frame change event is generated every time the frame changes in your scene but also when you launch blender and when you render the scene
You can link a script to this event so that the script will be executed each time the event is generated.