I have two buttons operators, I've disabled one from the start using the below line, where started is False:

def poll(cls, context):
        return started

I wonder how I can enable it back when I click on another button operator which sets the bool started to True?


Eeeeh… where do you store that started variable?

Either you use a global variable here (which is not recommended, but would work) or, much more recommended, you add a new property to WindowManager class to store that bool, and retrieve it in your poll() func through the context parameter…


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.