I wrote a script that handles baking objects textures into an image node that is then attached back to a bsdf node. It works well for the most part. It's just really slow. Like 45 seconds - 90 seconds for the baking process. I'm wondering if there is a way to optimize the script I wrote, or is this just as good as it gets? The problem I'm trying to solve here is that I have a collection of objects that I need to iterate through and bake each one. The actually project this is for has hundreds of sub-collections and objects. At its current output speed for each object, it will take days or even a week to bake all the objects lol.
Any advice or feedback is super appreciated! Thanks