This question already has an answer here:
I have been trying to write my first addon for Blender over the last couple of days. One error I came across quite often is the
context is incorrect error for an operation of
I learned that one can ask the poll function of an operator if the context is correct, but this does not tell why the context is correct/incorrect. What would be the best way to figure that out? Only way I could think of is to look into the code of the poll function. If that is the best way, what is the fastest way to find the appropriate piece of code?