getting combine_mode status?

edited November 2016 in Python scripting
Hi,
I'd like to create a keyboard shortcut for cycling between the erase/add combine modes
(accessible through the menubar otherwise).
For this purpose, I tried to create a python script along the following lines:

~~~~
win = pya.Application.instance().main_window()
menu = win.menu()
act = menu.action("@toolbar.combine_mode.combine_mode_erase")
if act.is_checked():
act = menu.action("@toolbar.combine_mode.combine_mode_add")
act.trigger()
else:
act.trigger()
~~~~

The "is_checked" function does not however work as I would like it to work.
Is there some other way to check what the current combine mode status is?

Thanks!

Comments

  • edited November 2016

    Hi,

    that's a configuration item embedded in the menu. It does not bind to an Action.

    That's why you do it this way:

    RBA::Application.instance.set_config("combine-mode", "erase")
    

    Values are:

    • add
    • merge
    • erase
    • mask
    • diff

    Matthias

Sign In or Register to comment.