I have a project in Blender that provokes a shape to move in certain ways based on two values (currently I manually change the values in the Python script in Blender and manually click to render to an MP4 file). The goal in mind is to have a web page that collects these two values and passes them into Blender to render a video (MP4) and write it out to a certain location. Essentially I want to automate the render upon the opening of this particular blender file.

I am relatively new to Blender, but I did notice that when I move my cursor over each setting, Python code is displayed. I have been trying to reference that code and the online documentation to auto-render, but I not having any luck.

The command shown to render is bpy.ops.render.opengl(animation=True). However, I am confused on where I would need to place this line of code to initiate the render. I have a python script that will open up blender and my blender file, but I just need a little guidance on how to pull off this next process.

  • 1
    $\begingroup$ It doesn't matter where you put the render line, of course everything should be set before you render. Have a look at this answer, I think it is exactly what you need blender.stackexchange.com/questions/6817/… $\endgroup$
    – WhatAMesh
    Mar 1, 2019 at 5:02
  • $\begingroup$ Thanks WhatAMesh, that did the trick. (thanks Duarte Farrajota Ramos as well) $\endgroup$
    – Garrett
    Mar 1, 2019 at 22:52


Browse other questions tagged .