Blender Git Loki

Git Commits -> Revision bf948b2

Revision bf948b2 by Hans Goudey (master)
September 23, 2021, 02:57 (GMT)
Custom Properties: Rewrite edit operator, improve UX

This commit changes the custom property edit operator to make editing
different properties types more obvious and 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, 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.

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 when necessary.
- Code is commented, split up, and much easier to understand.

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. Though in the "Python" mode the value is still available.

More improvements are possible in the future, like exposing different
subtypes, and improving the UI of the custom properties panel.

Differential Revision: https://developer.blender.org/D12435

Commit Details:

Full Hash: bf948b2cef3ba340a6bba5e7bd7f4911c9a9275a
Parent Commit: 6e77afe
Lines Changed: +450, -254

2 Modified Paths:

/release/scripts/modules/rna_prop_ui.py (+3, -2) (Diff)
/release/scripts/startup/bl_operators/wm.py (+447, -252) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021