This patch changes the custom property edit operator to make editing different
types of properties more obvious, and to expose more of the data, made more
easily possible by the recent UI data refactor.
Previously the operator guessed the type you wanted based on what you wrote
in a text box. That was problematic though, you couldn't make a string property
with a value of 1234, and you had to know about the Python syntax for lists
in order to create an array property. It was also slow and error prone; it was
too easy to make a typo and end up with a string property instead.
Improvements compared to the old operator:
- A type drop-down to choose between the property types.
- Step and precision values are exposed.
- Buttons that have the correct type based on the property.
- String properties no longer display min, max, etc. buttons.
- Generally works in more cases. The old operator tended to break.
- Choose array length with a slider.
- Easy to choose to use python evaluation to type a value when necessary.
- Code is commented, split up, and much easier to understand (for me at least).
- Code is explicit, works more "on purpose" than "by mistake".
The custom property's value is purposefully not exposed, since the Edit
operator is for changing the property's metadata now, rather than the value itself.
In the "Python" mode though, the value is still presented as a string.
In the process of working on this, I ended up having to make cleanup
changes to understand the code properly. I could split out some of these
if necessary, but the patch is really more of a rewrite anyway.




