Need help finding an add-on

General project and community related discussions and offtopic threads.
Post Reply
PDRA
Posts: 41
Joined: Fri Sep 27, 2019 8:49 pm

Need help finding an add-on

Post by PDRA » Sat Apr 11, 2020 4:51 pm

Hi guys!
I hope you are doing well.
I'm currently working in a scene where I require to render different collections.
To explain it briefly, what I'm doing is I separated the collections like this:
Collection 1: 3D Model A
Collection 2: 3D Model B
Collection 3: 3D Model C
Collection 4: Lighting setup 1 Camera A
Collection 5: Lighting setup 2 Camera B
Collection 6: Lighting setup 2 Camera B
and so on...

I have to make a render of each model I have with those different lighting setups I organized.
What I would like to do is to batch render all these elements and combinations I have instead of setting them manually after each one ends.

I know about render burst plugin but it doesn't work like that. Is there any other add-on that could help me with this?

Regards, saludos
Pablo

User avatar
Sharlybg
Donor
Posts: 2009
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Need help finding an add-on

Post by Sharlybg » Sat Apr 11, 2020 6:07 pm

Can light group reduce the need for multiple lighting collection ? Should work if there is no light mesh stop another geometry when placed in same collection.
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA

tokiop
Posts: 23
Joined: Fri Apr 13, 2018 8:11 pm

Re: Need help finding an add-on

Post by tokiop » Sat Apr 11, 2020 10:32 pm

Hi Pablo,

for batch product rendering I render through command line. These docs were helpful : commandline rendering, commandline arguments .

It is a nice introduction to start using little scripts. An useful command is --python-expr, it allows you to pass some script command to hide an object, change scene, change output resolution (preview/final). Using the blender GUI to setup the scene, check if the scripts commands work, is very straightforward. Once your "render script" is done, you can change the lighting, and rerender all your previews/products in on go... you quickly don't regret taking time to setup this ! :)

Attached is a basic example script to render all objects * light setup * camera combination from within the blender interface. To run the script, hit [Alt + P] or from menu : text > run script.

Code: Select all

import bpy;

resolution_pc = 20
lights = ["Lights1", "Lights2"]
objects = ["Product1", "Product2"]
views = ["Camera", "Camera-closeup"]

for object in objects:
	for light in lights :
		for view in views :
			
			
			# Set render visibility for objects and lights
			for o in objects :
				bpy.data.collections[o].hide_render = False if (o == object) else True
				
			for l in lights :
				bpy.data.collections[l].hide_render = False if (l == light) else True
				
			# Set main camera
			bpy.data.scenes["Scene"].camera = bpy.data.objects[view]
			
			#Render
			
			filename = '-'.join([object, view, light]) + ".png"
			print("Rendering to : " + filename)
			
			bpy.context.scene.render.filepath = '//renders/' + filename
			bpy.ops.render.render(write_still=True)
Print statements and error, very helpful to understand what is going on, are available if you launch from the commandline, I'm not sure if theses infos are available from the GUI.

Victor
Attachments
blender-simple-batch-render.zip
(139.3 KiB) Downloaded 6 times

PDRA
Posts: 41
Joined: Fri Sep 27, 2019 8:49 pm

Re: Need help finding an add-on

Post by PDRA » Sat Apr 11, 2020 11:13 pm

Thank you a lot guys for the help!

@Sharlybg: Thanks for the suggestion! However, in this case, changing to different collections is a must because I have instanced elements disposed in different positions/rotations, different meshes as studios, and many other elements. By the way, you are doing great tutorials! Keep the great work!

@tokiop: Thanks a ton for the info and your time mate! Right now scripting is something that I know almost nothing about but it is something that I definitely want to learn. I will use all the info you gave me! However, I had to opt for an already created solution due to the fact that the deadline is very close and learning scripting from scratch will take me a lot and also it will get to me many tries and errors to get it at an acceptable and stable level. Thank you man again for your dedication in order to guide me, I really appreciate it!

I have found a wonderful add-on! For those who might be in a similar situation, it is called "Render "

All the best, saludos!
Pablo

Post Reply