Author Topic: Question about sbsbaker optimisation  (Read 2557 times)

Hi, I've been using the sbs baker to do some high to low poly bakes through a python script. The poly count of the meshes I'm baking from are in the millions and I've noticed that the baking takes a lot longer than if i were to do it manually through substance designer. I'm wondering why that is?

I'm guessing it may be because each call to sbsbaker is reloading the high poly meshes rather than loading them once and doing all the bakes then. Is there a way to improve my approach to this?

Here's some example code from my script:

batchtools.sbsbaker_color_from_mesh(lowpoly, highdef_mesh=hpmeshes, output_size=[outRes, outRes], max_frontal='1', max_rear='0.01', output_format="png", output_path=TargetLocation, output_name="colormask").wait()
batchtools.sbsbaker_opacity_mask_from_mesh(lowpoly, highdef_mesh=hpmeshes, output_size=[outRes, outRes], max_frontal='1', max_rear='0.01', output_format="png", output_path=TargetLocation, output_name="maskout").wait()
batchtools.sbsbaker_curvature_from_mesh(lowpoly, highdef_mesh=hpmeshes, output_size=[outRes, outRes], max_frontal='1', max_rear='0.01', output_format="png", output_path=TargetLocation, output_name="curvature").wait()
batchtools.sbsbaker_ambient_occlusion_from_mesh(lowpoly, highdef_mesh=hpmeshes, output_size=[outRes, outRes], max_frontal='1', max_rear='0.01', output_format="png", output_path=TargetLocation, output_name="ambientocclusion").wait()
batchtools.sbsbaker_height_from_mesh(lowpoly, highdef_mesh=hpmeshes, output_size=[outRes, outRes], antialiasing='1', max_frontal='1', max_rear='0.01', output_format="png", output_path=TargetLocation, output_name="height").wait()
batchtools.sbsbaker_thickness_from_mesh(lowpoly, highdef_mesh=hpmeshes, output_size=[outRes, outRes], max_frontal='1', max_rear='0.01', output_format="png", output_path=TargetLocation, output_name="thickness").wait()


Thanks,
Ole

Yes, you guessed right.
 It's a problem that we have in mind and it's planned to work on it to improve that.
At the moment, the best that you can do is to improve your code with parallelization maybe the best is a python multiprocessing pool.

Thanks for your response, I'll look into that.