There are buttons for switching to object mode, edit mode, pose mode and others. How to make sure which of these modes is active using Blender's Python API? Any information would help! Preferably with at least a small example of two simple buttons. For example, layers I managed to do on. off. But layers are not suitable. I will be very glad to your tips. Thank you very much! enter image description here

  • $\begingroup$ In earlier versions, or later with developer extras checked in user prefs > interface > display, you can right click on UI elements and view source. My guess (as I don't have Avatar tools whatever addon) is they are booleans that when toggled update the mode, and unset the previous. $\endgroup$ – batFINGER Oct 11 '18 at 11:40

You can get the current activated mode with the following:


This will print things like OBJECT, EDIT, WEIGHT_PAINT, POSE etc


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.