Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-07Cleanup: unify struct declaration style for Python types, update namesCampbell Barton
Use struct identifiers in comments before the value. This has some advantages: - The struct identifiers didn't mix well with other code-comments, where other comments were wrapped onto the next line. - Minor changes could re-align all other comments in the struct. - PyVarObject_HEAD_INIT & tp_name are no longer placed on the same line. Remove overly verbose comments copied from PyTypeObject (Python v2.x), these aren't especially helpful and get outdated. Also corrected some outdated names: - PyTypeObject.tp_print -> tp_vectorcall_offset - PyTypeObject.tp_reserved -> tp_as_async
2022-02-14Merge remote-tracking branch 'origin/blender-v3.1-release'Sybren A. Stüvel
2022-02-14Fix segfault calling `id_properties_ui("prop").update()`Sybren A. Stüvel
Fix segfault when calling `some_id.id_properties_ui("propname").update()`, i.e. call the `update()` function without any keyword arguments. In such a case, Python passes `kwargs = NULL`, but `PyDict_Contains()` is not `NULL`-safe.
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2021-11-02Fix T92532: Missing null checks in IDPropertyManager.update_fromHans Goudey
Calling it with a None argument, or no arguments, or with a property that is missing UI data for some reason would fail. There is no particular reason why ensuring those things don't happen is helpful, so just add null checks for safety. Differential Revision: https://developer.blender.org/D13024
2021-09-08Fix T91255: IDProperty UI as_dict() returns step as default valueHans Goudey
Another typo in this section of code.
2021-09-02Cleanup: GrammarHans Goudey
2021-09-02Cleanup: spelling in commentsCampbell Barton
2021-09-01Cleanup: move RNA utility functions into a generic moduleCampbell Barton
Avoid having to include bpy_rna.h for enum utility functions, recently added to idprop_py_ui_api.c.
2021-08-31Fix: Output int for precision in UI data as_dict methodHans Goudey
This is stored internally and used as an integer, so there is no need to convert it to a float for "as_dict". This was just an oversight.
2021-08-27Refactor IDProperty UI data storageHans Goudey
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