I spent most of the morning today digging for information on BP decorators and this is the understanding I’ve come to (please correct me if I’ve got it wrong):
First, a Python concept…
Decorators wrap functions so you, as a coder, can have something happen before and/or after the function is called without having to mess with changing the function itself.
Now, the BP concept…
The @classmethod decorator wraps any function so it will be called before its class’s execute() method.
Okay, I just found out @classmethod is a Python thing, not BP. But what I read also said it’s rarely used in classes, but BP code seems to use it in classes a lot. Also, the mention I found of this didn’t distinguish the difference between classmethod and staticmethod. Is staticmethod similar to singletons in other OOP languages?
The poll() method is used to make sure the class is being called while the user has Blender set to an appropriate mode such as Edit Mode, Object Mode, etc.
So far, so good?
I tried to find a list of BP decorators and what they’re used for, but didn’t find anything. I Googled, I dug into the API, and I scoured this forum. Most of what I’ve written above I gleaned from postings by batFINGER, CoDEmanX and tmaes.
Is there comprehensive documentation on this stuff? If so, would someone kindly post a link?