# How can I batch render lots of objects individually?

I have over 100 objects I need to render out as catalogue style images. What would be the most efficient way to render these all these with the same environment, lighting, material and camera angle?

• Keep them at the center of the world and switch their visibility in the Outliner (both Hide in Viewport and Disabke in Renders)? Or put each of these objects in a collection and enable/disable these collections? – moonboots Jan 15 at 6:30
• same environment, lighting and camera can be achieved using one file with an object, after each render change the object data to the next object and render, repeat as needed, a script will make this task much less daunting – Georges Jan 15 at 9:17
• What is the file format of your objects? .blend or something like .obj, .fbx, ...? – Quacksilber Jan 16 at 19:06
• The file format is Stl files – user3247041 Jan 17 at 21:38

I've written a very basic AddOn, that does basically what you need.

### How to use the AddOn:

The AddOn let's you select your files, puts them one after another in your current scene, and renders them to an outpu-directory.

By clicking it, you open a file-browser-window.

Select all your files you intend to render and press "Select Files to Render".

Blender then renders all of your selected objects into an "output"-folder, that is created in the same location, that your current .blend-file is located in. The rendered images will be given the objects filename (without the extension). For example "suzanne.obj" may be rendered and saved to "suzanne.png". All other rendersettings are taken from Blender directly.

Besides the .stl-format, .obj, .fbx and .blend files are supported.

Disclaimer: Since I don't have that much experience in writing AddOns, I can't guarantee you, that it works flawlessly. As far as I've seen, it works for me. Code-quality is probably a mess and the AddOn lacks some pleasant UX features as, for example, render-progress. (Blender is not responsive during the rendering!)

### How it works / Code-snippets used

This is a more detailed description of what I did, in case you want to create your own script out of it.

An ImportHelper is used to fetch the different files.

I then iterate over each file,

for file in files:
filename, extension = os.path.splitext(file.name)
filepath = os.path.join(directory, file.name)


create a temporary collection for each object,

collection = bpy.data.collections.new("tmp-collection")
scene = context.scene


and import the object into this collection.

bpy.ops.import_mesh.stl(filepath)

for obj in bpy.context.selected_objects:


I then render the scene to the output-folder

scene.render.filepath = "//output/"+filename
bpy.ops.render.render(write_still=True)


and delete the temporary-collection with its containing objects.

for c in scene.collection.children:
if c.name == "tmp-collection":