switching rendering object (group instance) for multiple image output

I have a bunch of objects and cameras and would like to render each object from different cameras (I also want to rotate my object between renders). Finally, I would like the renders to have names that refers to what object and camera angle was used.

Seems easiest to have each object have a group so that i can make a group instance and delete it when I’m done.

  • What is the easiest way to get a list/array/object containing all the names of the available groups in the scene?
  • How do you loop through this list in order to create, rotate and finally delete group instances?

[I would also like to know how to start and wait for rendering, save image and naming of the images, but I think I can learn this from other examples]

Turns out is was as easy as

objects = []
for group in bpy.data.groups:

If someone should have the same issue that I had, I’m adding an example in test_autoRender.blend (538 KB). It’s a mix of stuff I found, so it can probably be cleaned up a bit.

What it does:

  • Find all groups in the document
  • Take each group and render once for each specified camera angle
  • Save each render with name pointing to object and camera angle used