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-10-03Cleanup: spelling in commentsCampbell Barton
Also replace "dm" for evaluated mesh in some comments.
2022-09-25Cleanup: remove redundant double parenthesisCampbell Barton
2022-06-27Cleanup: spelling in commentsCampbell Barton
2022-06-23Fix T97691: undefined behavior sanitizer warning for alignment in RNA functionsBrecht Van Lommel
Thanks Loren Osborn for investigating this and proposing solutions. Ref D14798
2022-05-31RNA: add macros for EnumPropertyItem layout elementsCampbell Barton
Add the following macros for enums as support for these features wasn't all that obvious and there were some inconsistencies in their use. - RNA_ENUM_ITEM_HEADING(name, description) - RNA_ENUM_ITEM_SEPR - RNA_ENUM_ITEM_SEPR_COLUMN
2022-05-26UI support for showing candidates for string propertiesCampbell Barton
Currently strings are used for cases where a list of identifiers would be useful to show. Add support for string properties to reference a callback to populate candidates to show when editing a string. The user isn't prevented from typing in text not found in this list, it's just useful as a reference. Support for expanding the following strings has been added: - Operator, menu & panel identifiers in the keymap editor. - WM operators that reference data-paths expand using the Python-consoles auto-complete functionality. - Names of keying sets for insert/delete keyframe operators. Details: - `bpy.props.StringProperty` takes an option `search` callback. - A new string callback has been added, set via `RNA_def_property_string_search_func` or `RNA_def_property_string_search_func_runtime`. - Addresses usability issue highlighted by T89560, where setting keying set identifiers as strings isn't practical. - Showing additional right-aligned text in the search results is supported but disabled by default as the text is too cramped in most string search popups where the feature would make sense. It could be enabled as part of other layout tweaks. Reviewed By: brecht Ref D14986
2022-05-17Cleanup: Use `switch` and `BLI_assert_unreachable()` more.Bastien Montagne
Replace some `if/else if` chains by proper `switch` statement. Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-03-09Cleanup: use ELEM macroCampbell Barton
2022-02-21RNA: modify debug mode logic for setting invalid unset valuesCampbell Barton
The previous behavior called RNA_enum_item_add a second time, filled it's contents with invalid values then subtracted totitem, this caused an unusual reallocation pattern where MEM_recallocN would run in order to create the dummy item, then again when adding another itme (reallocating an array of the same size). Simply memset the array to 0xff instead.
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-12-08Cleanup: move public doc-strings into headers for 'makesrna'Campbell Barton
Ref T92709
2021-07-30PyAPI: defer freeing existing properties on registrationCampbell Barton
Registering a property could remove the existing property, then fail to parse one of the arguments of the new property - leaving the struct without a property. Now freeing the existing property is deferred until immediately before the new property is registered.
2021-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-05-17UI: add non-linear slider supportHenrik Dick
This patch introduces non linear sliders. That means, that the movement of the mouse doesn't map linearly to the value of the slider. The following changes have been made. - Free logarithmic sliders with maximum range of (`0 <= x < inf`) - Logarithmic sliders with correct value indication bar. - Free cubic sliders with maximum range of (`-inf < x < inf`) - Cubic sliders with correct value indication bar. Cubic mapping has been added as well, because it's used for brush sizes in other applications (Krita for e.g.). To make a slider have a different scale type use following line in RNA: `RNA_def_property_ui_scale_type(prop, PROP_SCALE_LOGARITHMIC);` or: `RNA_def_property_ui_scale_type(prop, PROP_SCALE_CUBIC);` Test the precision, step size and soft-min if you change the scale type of a property as it will feel very different and may need tweaking. Ref D9074
2021-04-13DNA: support int8_t type in DNA structsJacques Lucke
Differential Revision: https://developer.blender.org/D8908
2021-03-18Cleanup: spellingCampbell Barton
2021-03-16Fix T86332: Error using lambda in annotations in Python 3.10Campbell Barton
Callbacks used in `bpy.props` didn't hold a references to the functions they used. While this has been the case since early 2.5x it didn't cause any problems as long as the class held a reference. With Python 3.10 or when using `from __future__ import annotations`, the annotations are no longer owned by the class once evaluated. Resolve this by holding a reference in the module, which now supports traverse & clear callbacks so the objects are visible to Python's garbage collector. Also refactor storage of Python data, moving from an array into a struct.
2021-03-05Cleanup: Rename func occurences to _fnSebastián Barschkis
Use _fn as a suffix for callbacks.
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-27RNA: Add warning to float percentage property definitionHans Goudey
As a followup to rBc71a8e837616159735, add a debug-only check for incorrect range, when the percentage and factor functions were likely confused.
2021-01-17RNA: report an error when the name property is set twiceCampbell Barton
This helps avoid copy-paste errors which have happened a few times, no functional changes.
2020-11-25Cleanup: Typo in `print_default_info` function name.Bastien Montagne
2020-11-19Fix RNA not giving error with invalid identifiers for collection propertiesBrecht Van Lommel
2020-11-17RNA define: check and report invalid usages of ID pointers properties.Bastien Montagne
Some RNA structs, like operators or keymaps, are not allowed to have ID pointer properties. now this check will ignore those, and report an error message in the console. Related to T82597. Notes: While a bit more involved than rBf39fbb3e6046, this commit remains fairly localized and non-intrusive. It relies on some rather obscure and weird behaviors of our RNA code though, a cleaner solution could be e.g. to add a tye to `StructOrFunctionRNA`, so that we could properly 'rebuild' (re-cast) the pointer to either `StructRNA` or `FunctionRNA` when needed in internal code...
2020-11-16Revert "RNA define: check and report invalid usages of ID pointers properties."Bastien Montagne
This reverts commit f39fbb3e604611b63c69661dd22ca987fb1d8791. Code is not valid, `DefRNA.laststruct` does not always point to the proper struct when defined from Python, need to be done differently.
2020-11-16RNA define: check and report invalid usages of ID pointers properties.Bastien Montagne
Some RNA structs, like operators or keymaps, are not allowed to have ID pointer properties. now this check will ignore those, and report an error message in the console. Related to T82597.
2020-11-11Cleanup: Use `NDEBUG` define, `DEBUG` one is not reliable.Bastien Montagne
2020-11-07Cleanup: Clang-tidy else-after-returnAnkit Meel
2020-11-06Cleanup: use ELEM macroCampbell Barton
2020-11-02Fix py-defined pointer properties wrong tag re ID ownership.Bastien Montagne
This fixes critical bug with liboverride when soe add-ons add some RNA ID Pointer properties. ID pointers should **never** have ownership of their ID when defined from python. (As a reminder, RNA properties owning their ID pointers are extremely rare even from C code, only embedded IDs (root node trees, master collections) and the shape keys snowflakes are concerned.)
2020-10-20Cleanup: makesrna, Clang-tidy else-after-return-fixes.Ankit Meel
It got left out of {rBc04088fed1b8faea6b2928bb5e09ab3}. No functional change.
2020-09-29DNA: use better type for SDNA->structsJacques Lucke
The data layout remains exactly the same.. This change just gives all the elements in `SDNA->structs` names, making it more comfortable to work with the data. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D8926
2020-08-08Cleanup: use array syntax for sizeof with fixed valuesCampbell Barton
Also order sizeof(..) first to promote other values to size_t.
2020-06-29RNA: Add a way to prevent automatic addition of 'no ownership' flag for ID ↵Bastien Montagne
pointer properties. Since makesrna runs after all properties have been defined, we have to remember with a new internal flag when we explicitely disable the 'PROP_PTR_NO_OWNERSHIP' flag for a property. Otherwise there was no way to do so for ID pointer properties...
2020-06-18Cleanup: redundant parenthesisCampbell Barton
2020-06-04LibOverride: Add Pointer properties to 'overridable by default'.Bastien Montagne
There is in fact no reason not to do so, RNA pointers are either to other IDs (which is properly handled by default diffing code), or to sub-structures that should almost always be diffed as well. Exceptions (like backward ID pointers or strictly runtime caches and data) are to be handled with proper 'no comparison' flag in any case.
2020-06-03RNA: add option to enable by default lib overridale flag of defined properties.Bastien Montagne
Similar to the one allowing to deactivate DNA check, etc. Will helps reduce verbosity when making many new properties overridable. Note that pointer properties always remain non-overridable by default, since basically only ID pointers should be. Reviewed By: brecht Maniphest Tasks: T77083 Differential Revision: https://developer.blender.org/D7906
2020-06-02Turn most flags in BlenderDefRNA into proper bool.Bastien Montagne
2020-06-02Cleanup: RNA: use `BlenderDefRNAtruct` named members initialization.Bastien Montagne
2020-04-03Cleanup: Rename ExtensionRNA variables from ext to rna_extJulian Eisel
Makes it more clear that code using this is related to the RNA integration of a type. Part of T74432. Also ran clang-format on affected files.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-18Fix BPY enum property definiton failing if items contain spacesJulian Eisel
Mistake in 03a4d3c33f82, turns out this actually is called from BPY (which I didn't think it was). So only error out during makesrna, not at runtime.
2020-03-17Cleanup: Fix warnings about function signature of register passRay Molenkamp
RE_engine_register_pass is sometimes in the headers with type as an integer parameter, sometimes as eNodeSocketDatatype. This caused warnings, the root cause was makesrna was not able to generate the proper type for enums and defaulted to int. makesrna has been extended with the RNA_def_property_enum_native_type that allows telling makesrna the native type of an enum, if set it will be used otherwise it will still fall back to int. Differential Revision: https://developer.blender.org/D7117 Reviewed By: brecht
2020-03-04Cleanup: use MEM_recallocN_id utility functionCampbell Barton
2020-03-04RNA: ensure missing calls to RNA_enum_item_end crash in debug modeCampbell Barton
Would have prevented T74227 from slipping through since it didn't crash on some systems.
2020-03-03RNA: support 64 bit boolean bitflags in DNABrecht Van Lommel
This does not affect the RNA access API, since how the boolean is read from DNA abstracted away in the API. Differential Revision: https://developer.blender.org/D7002