Hi
I’m working on a baking addon which makes baking light map easier and so far it does the job, but it has a problem:
The blender ui freezes while baking is in progress.
So how can i bake image without freezing ui and showing default progress bar like blender does?
Nice!
But then how can i find out when baking process is finished or cancelled?
I’ve looked into bpy.app’s persistent handlers but there is no event for baking.
I need to run a function after the image has been baked(i’m editing the baked image via imagemagick command).
I’ve noticed the bpy.ops.object.bake_image(‘INVOKE_DEFAULT’) returns “{RUNNING_MODAL}”. so maybe there is a way to handle this via modal or invoke method in my addon?
so far as I know, there is no way to catch the end of a generic modal operator, or the result of an operator, which, in my view, constitutes a huge design blunder.
You can however look for the event handlers in bpy.app, if they do what you want. The other way is to run a modal operator and regularly check for side-effects of the baking process (if there are any).
I’ve tried bpy.app.handlers.scene_update_post handler which gives me some chances to get when baking process is done.
Let’s say tex is my baking texture and img is my baking image, so in this handler when i press my addon bake button, i’ll get this:
But i can’t get any different result on finished baking process or cancelled one. so i guess i’ll try a different approach in my addon. maybe another button to do the post bake stuff, if user will.
Thanks.