Go to file
Hans Goudey 8b9a3b94fc Refactor IDProperty UI data storage
The storage of IDProperty UI data (min, max, default value, etc) is
quite complicated. For every property, retrieving a single one of these
values involves three string lookups. First for the "_RNA_UI" group
property, then another for a group with the property's name, then for
the data value name. Not only is this inefficient, it's hard to reason
about, unintuitive, and not at all self-explanatory.

This commit replaces that system with a UI data struct directly in the
IDProperty. If it's not used, the only cost is of a NULL pointer. Beyond
storing the description, name, and RNA subtype, derived structs are used
to store type specific UI data like min and max.

Note that this means that addons using (abusing) the `_RNA_UI` custom
property will have to be changed. A few places in the addons repository
will be changed after this commit with D9919.

**Before**
Before, first the _RNA_UI subgroup is retrieved the _RNA_UI group,
then the subgroup for the original property, then specific UI data
is accessed like any other IDProperty.
```
prop = rna_idprop_ui_prop_get(idproperties_owner, "prop_name", create=True)
prop["min"] = 1.0
```

**After**
After, the `id_properties_ui` function for RNA structs returns a python
object specifically for managing an IDProperty's UI data.
```
ui_data = idproperties_owner.id_properties_ui("prop_name")
ui_data.update(min=1.0)
```
In addition to `update`, there are now other functions:
 - `as_dict`: Returns a dictionary of the property's UI data.
 - `clear`: Removes the property's UI data.
 - `update_from`: Copy UI data between properties,
   even if they have different owners.

Differential Revision: https://developer.blender.org/D9697
2021-08-27 08:27:24 -05:00
.github Add Probot Stale configuration file 2019-10-11 14:13:29 +02:00
build_files Windows/Ninja: Optimize linker performance 2021-08-25 10:55:45 -06:00
doc DocPy: Update Dependancies 2021-08-20 13:46:38 -04:00
extern Audaspace: porting PulseAudio fixes from upstream. 2021-08-18 22:22:21 +02:00
intern Add locking fallback atomics implementation 2021-08-26 14:36:59 +02:00
release Refactor IDProperty UI data storage 2021-08-27 08:27:24 -05:00
source Refactor IDProperty UI data storage 2021-08-27 08:27:24 -05:00
tests Refactor IDProperty UI data storage 2021-08-27 08:27:24 -05:00
.arcconfig Fix .arcconfig not working with latest arcanist version 2020-03-01 22:35:31 +01:00
.clang-format Cleanup: update clang-format so PyObject_HEAD indents properly 2021-06-24 17:12:04 +10:00
.clang-tidy Cleanup: enable modernize-use-equals-default check 2021-04-08 11:07:27 +02:00
.editorconfig editorconfig: correct indent size 2019-04-17 13:34:46 +02:00
.git-blame-ignore-revs Cleanup: git-blame-ignore-revs: Update policy & commits 2021-01-29 13:20:32 +05:30
.gitignore Compositor automated testing 2021-03-26 16:15:02 +01:00
.gitmodules Update for moving blender2.8 to master. 2018-12-21 12:15:21 +01:00
CMakeLists.txt Cleanup: fix comment about compiler support. 2021-08-22 22:15:28 +05:30
COPYING
GNUmakefile Cleanup: tab indentation for CMake / GNUmakefile 2021-08-05 12:03:41 +10:00
make.bat Cleanup: trailing space, remove BOM 2021-08-11 10:11:11 +10:00
readme.rst Blender README: Fix the full license name. 2021-04-09 12:39:33 +02:00

.. Keep this document short & concise,
   linking to external resources instead of including content in-line.
   See 'release/text/readme.html' for the end user read-me.


Blender
=======

Blender is the free and open source 3D creation suite.
It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing,
motion tracking and video editing.

.. figure:: https://code.blender.org/wp-content/uploads/2018/12/springrg.jpg
   :scale: 50 %
   :align: center


Project Pages
-------------

- `Main Website <http://www.blender.org>`__
- `Reference Manual <https://docs.blender.org/manual/en/latest/index.html>`__
- `User Community <https://www.blender.org/community/>`__

Development
-----------

- `Build Instructions <https://wiki.blender.org/wiki/Building_Blender>`__
- `Code Review & Bug Tracker <https://developer.blender.org>`__
- `Developer Forum <https://devtalk.blender.org>`__
- `Developer Documentation <https://wiki.blender.org>`__


License
-------

Blender as a whole is licensed under the GNU General Public License, Version 3.
Individual files may have a different, but compatible license.

See `blender.org/about/license <https://www.blender.org/about/license>`__ for details.