I am trying to make it so that pressing the "Play Animation" button would set my custom boolean variable to true and pressing the "Cancel Animation" button after would set the same boolean variable to false.

How would I go about linking my custom function to a pre-existing button so that it is called when the button is pressed?


1 Answer 1


Why reinvent the wheel?

If you press play the pause button is shown and vice versa. Turn on developer extras and view source and will find

if not screen.is_animation_playing:

to draw the pause button. screen is the context screen.

Hence your boolean property could be replaced by or driven with bpy.types.Screen.is_animation_playing

Notice it belongs to screen not scene as it can be set on a per screen basis.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .