Help with macro and modal ops

Hi guys, anyone here knows about macro operators? I’ve been trying to make a macro op that runs wm_save_mainfile and then wm_quit_blender for D566.

However, the quit op is never called. I think it’s because save_mainfile is modal (and needs to be that way). Anyone knows if it’s possible to run modal -> non-modal in a macro op?

1 Like

TL;DR - it should work, we just need to add support for it :slight_smile:

Macros in Blender aren’t heavily used, they’re rarely used from Python (since it’s often easier to simply call another operator from within a script). And only used for a handful of operators defined in C, loopcut for eg).

You’ve most likely stumbled on a mix of modal/non-modal operators that hit a limit in how macros work. I’ll check on adding support for this.

1 Like

Yeah I figured there was some limitation there. It’d be great if we could have support for this case, thanks!

For reference here is a patch that supports macros running after the file selector - P607 - but am not happy with it (thought this might have been something we could support). Suggested alternative in the D566.

Seems like it was more trouble than it was worth it. I guess if this limitation hadn’t been hit in all these years, it means it’s not really that important. I like the alternative of adding an option to the save op, I’ll get back to that patch soon