The API says:
The actual state that is returned is an internal number that varies tool to tool.
That is a bit vague. To be more precise. There is no standard whatsoever that all the internal “native” tools adhere to.
It certainly would be nice. Usually for most tools the initial state is 0
, and when the tool is reset (normally by pressing ESC key.)
Some would argue it’s not a bug because it never had any state changes. But logging it as a bug is the best way to eventually get it fixed.
Problem is they are unlikely to stay the same, forever. Or at least unlikely to stay integers.
If a new feature is added, in between two states, say in between 1 and 2, then the obvious choice rather than change all the state numbers (and break a bunch of plugins,) is to make the new state be 1.5, (or similar.)
So, basically, even though the API has observers to see when tool states change, they have not given the feature “much love.” It is like “painting themselves into a corner” for future tool expansion.
I would recommend the API switch to symbol state names, instead of sequential integers.
Ie, for the RotateTool, the first could be called :initial
, then either :pickaxis
or :dragaxis
depending upon how the user uses the mouse, then :pickpoint1
and then :pickpoint2
, (or :pickangle
,) etc.
Another thing I wonder. How would we see when tools are switched to “copymode” or “alignmode”, ie, modifier modes with SHFT, CTRL, ALT keys (or combinations.)