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
2021-02-19UI: fuzzy search in collection searchJacques Lucke
This adds fuzzy search functionality to various input fields in Blender where one can choose a value from many existing values (e.g. the Vertex Group property in the Displace modifier). Differential Revision: https://developer.blender.org/D10446
2021-02-18Cleanup: Use const argument, decrease variable scopeHans Goudey
2021-02-15Cleanup: clang tidyJacques Lucke
2021-02-08Fix for T84038: Improved Report WarningsHarley Acheson
Improved contrast for Status Bar report warning messages. Differential Revision: https://developer.blender.org/D10242 Reviewed by Hans Goudey
2020-11-06Cleanup: use ELEM macro (>2 args)Campbell Barton
2020-10-27Cleanup: use over-line for doxy commentsCampbell Barton
Follow our code style for doxygen sections.
2020-10-03Cleanup: Remove/replace C standard library assert() and header usagesJulian Eisel
We have our own assert implementation, `BLI_assert()` that is prefered over the C standard library one. Its output is more consistent across compilers and makes termination on assert failure optional (through `WITH_ASSERT_ABORT`). In many places we'd include the C library header without ever accessing it.
2020-09-18Cleanup: use 'UI_icon_*' prefix for icons APICampbell Barton
- UI_collection_color_icon_get -> UI_icon_color_from_collection - UI_idcode_icon_get -> UI_icon_from_idcode - UI_library_icon_get -> UI_icon_from_library - UI_mode_icon_get -> UI_icon_from_object_mode - UI_rnaptr_icon_get -> UI_icon_from_rnaptr - UI_alert_image -> UI_icon_alert_imbuf_get - UI_preview_render_size -> UI_icon_preview_to_render_size - UI_id_icon_render -> UI_icon_render_id
2020-09-04UI Code Quality: Use derived struct for number buttonsJulian Eisel
For the man rationale behind this design, see 49f088e2d093. Further, this removes users of uiBut.a1/uiBut.a2, which is a very ugly design choice (hard to reason about). Note that I had to do rather ugly, specific exceptions for the number buttons in `ui_def_but_rna()`. But once all users of a1/a2 are removed, this special handling shouldn't be needed anymore. I also had to move a sanity check out of the button definition. It's now moved into a new debug only sanity checking function executed when finishing the layout definition (block end).
2020-09-04Fix T78084: Search does not accept text fragments everywherePhilipp Oeser
This was reported for the "Add Node" search functionality, but is relevant in other searches as well. So e.g. when searching for "Separate XYZ", typing "sep", then " " (with the intention to type "X" next) would clear the search field. Now use the same method (matching against all search words) as in F3 searching ('menu_search_update_fn') in other searches as well [searching IDs, property objects, finding nodes,...] This should give a much nicer search experience in general. Note: this does not touch other searches in the Dopesheet, Outliner, Filebrowser or User Preferences that have other search implementations. Maniphest Tasks: T78084 Differential Revision: https://developer.blender.org/D8232
2020-09-01Fix T80258: UILayout.prop_search() issues with datablock namesPhilipp Oeser
If the search menu was used for a string property, and a data-block was selected from the search, the value set would be an invalid name. The property would get the modified UI string, not the proper data name set. This problem was already once solved in rB249ccab111ac, but resurfaced in rB937d89afba36. Now only use the modified UI string if requires_exact_data_name is not true. Note: the comments in rB249ccab111ac [reg. library hints and string properties, also that pointer properties are preferred over string properties when dealing with IDs] still apply. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D8759 (cherry picked from 2.90 commit cb0b0416f454419cd1902434f7dffa2682417a56)
2020-08-26Cleanup: use const variables in interface codeCampbell Barton
2020-08-19UI Code Quality: Use LISTBASE_FOREACH in interface directoryHans Goudey
I only skipped a few loops in the monstrous ui_handle_menu_event function. Also, I only changed variable names where necessary to prevent redeclarations. Differential Revision: https://developer.blender.org/D8586
2020-08-07UI Code Quality: Use derived struct for color buttonsJulian Eisel
For the main rationale behind this design, see 03b122e2a18df. Further, this removes users of `uiBut.a1`/`uiBut.a2`, which is a very ugly design choice (hard to reason about). Part of Part of T74432.
2020-07-23Fix T79162: 'prop_search' includes ID prefix in string propertiesCampbell Barton
Regression from d6cefef98f87a This also fixes an unreported issue where finding an exact match wasn't being detected for items that contained an ID prefix.
2020-07-03Cleanup: Interface, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors/interface` module. No functional changes.
2020-06-29UI: Show library status icons in search menus, rather than letter prefixJulian Eisel
Rather than a `L` (linked), `O` (overridden) or `M` (missing) prefix for the name, show the existing library status icons. See D7999 for screenshots. Note that when using preview icons, or if the search menu contains items with own icons (e.g. brush icons), we still fallback to the prefix solution. Zero or fake user is still indicated with a prefix. Differential Revision: https://developer.blender.org/D7999 Reviewed by: Bastien Montagne, William Reynish
2020-06-15Fix text after '|' being right aligned in the ID selectorCampbell Barton
Only use this to right align libraries when they are added to the name. Caused by d62bbf4079323.
2020-06-10UI: Show library names grayed out and right-aligned in menusJulian Eisel
Should separate the data-block name better from the library name and improve readability.
2020-05-11Merge branch 'blender-v2.83-release'Julian Eisel
2020-05-11Fix T76621: UILayout.prop_search() broken for data-block namesJulian Eisel
If the search menu was used for a string property, and a data-block was selected from the search, the value set would be an invalid name. The property would get the modified UI string, not the proper data name set. Mistake in rBd6cefef98f87. This is more of a temporary fix to make the menu behave like before above's commit. So the library hints this added will not be shown for string properties anymore. This would need further changes in the UI code (see https://developer.blender.org/P1380) but is too unsafe for 2.83 at this point. Even if this is done, the note below still applies. NOTE: Data-blocks should not be referenced by name only, as it's possible to have duplicate data-block names with linking and especially with library overriding. Instead, pointer properties should be used, `UILayout.prop_search()` can then properly deal with linked and overridden data-blocks.
2020-05-07Cleanup: split button search callbacks into their own structCampbell Barton
2020-05-06Cleanup: move search templates into their own filesCampbell Barton
2020-04-17UI: Better split layout support for checkboxesJulian Eisel
Makes the following layout changes possible: {F8473498} {F8473499} {F8473502} The next commit will contain many layout changes to make good use of these new possibilities. The result should be more consistent, easier to read and should give a more organized impression. Additionally, it should be possible to replace many sub-panels with compacter layouts. Main changes: * Checkboxes now respect the property split layouts * Add support for row and column headers (i.e. `uiLayout.column(heading="Foo")`, `uiLayout.row(heading="Bar")`). If the first property added to this layout doesn't insert anything into the label split column, the heading is inserted there. Otherwise, it's inserted as own item. * Add support for manually inserting decorators for an existing item (`uiLayout.prop_decorator()`). That way layout creators can manually insert this, which was the only way I saw to support property split layouts with a checkbox before the actual property. {F8471883} * Autogenerated layouts for operator properties look bad if there are only checkboxes (which only use half the region width). So before creating the layout, we iterate over visible properties and disable split layout if all are booleans. I think this is fine, if needed we could also add layout hints to operators. * `uiTemplateOperatorPropertyButs()` now handles macros itself, the caller used to be responsible for this. Code that didn't handle these so far never used macros I think, so this change should be invisible. * Remove manual property split layout from autogenerated operator properties layout. * Padding of checkboxes is tweaked to make their label visually more connected to the checkboxes. * Support split layout for menus (should work for `uiLayout.menu()`, `.operator_menu_enum()`, `.prop_menu_enum()`, maybe more) Maniphest Task: https://developer.blender.org/T65965 Differential Revision: https://developer.blender.org/D7427 Reviewed by: Brecht Van Lommel, William Reynish, Pablo Vazques
2020-04-10UI: Better support for linked data-blocks in search buttonsJulian Eisel
In RNA pointer search buttons (i.e. the ones with an eyedropper), data-blocks were handled badly. It was not possible to select a linked data-block that had the same name as a local one, which is especially common with library overrides. Neither was there a hint to tell appart linked data-blocks and which .blend file they come from. These issues are addressed now, we show an "L" prefix and the .blend file name in the search box (like in ID-templates). Changes here are quite simple, since the heavy lifting was already done through c20c203b8226. Addresses T73156.
2020-04-09Fix T75203: Crash when changing active keying setJulian Eisel
When updating the active button, the search data wasn't updated, so it kept using the old pointers. A check in `ui_rna_collection_search_cb()` relied on this incorrect behavior so I had to fix that too. Note that the previous commit was also needed for the second fix to work. Caused by c46dcdf8871e.
2020-04-09Fix error in UI_butstore_ APIJulian Eisel
If the `uiButStore` data was freed after the buttons/blocks were updated from previous instances (see `UI_block_update_from_old()`), e.g. by delaying that to the "afterfuncs" (`ui_apply_but_funcs_after()`), the data would get lost. As result, the button pointers that the API is supposed to keep valid would point to freed memory. This wasn't an issue so far since the API didn't happen to be used this way. That changes with the next commit.
2020-03-24UI: add menu search functionality to operator search menuCampbell Barton
This has some advantages over operator search: - Some operators need options set to be usefully accessed. - Shows key bindings to access menus (for actions that don't have key bindings themselves). - Non operator actions such as check-boxes are also shown. - Menu items can control execution context, using invoke or execute where appropriate so we can control how the operator runs. Part of the design task T74157. This can be tested using the 'Experimental' preferences section or selected in the key-map editor.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-09Cleanup: Replace ABS/SQUARE/CUBE with function callsSergey Sharybin
While it might be handy to have type-less functionality which is similar to how C++ math is implemented it can not be easily achieved with just preprocessor in a way which does not have side-effects on wrong usage. There macros where often used on a non-trivial expression, and there was at least one usage where it was causing an actual side effect/bug on Windows (see change around square_f(sh[index++]) in studiolight.c). For such cases it is handy to have a function which is guaranteed to have zero side-effects. The motivation behind actually removing the macros is that there is already a way to do similar calculation. Also, not having such macros is a way to guarantee that its usage is not changed in a way which have side-effects and that it's not used as an inspiration for cases where it should not be used. Differential Revision: https://developer.blender.org/D7051
2019-08-23RNA: Cleanup PointerRNA structJacques Lucke
The old layout of `PointerRNA` was confusing for historic reasons: ``` typedef struct PointerRNA { struct { void *data; } id; struct StructRNA *type; void *data; } PointerRNA; ``` This patch updates it to: ``` typedef struct PointerRNA { struct ID *owner_id; struct StructRNA *type; void *data; } PointerRNA; ``` Throughout the code base `id.data` was replaced with `owner_id`. Furthermore, many explicit pointer type casts were added which were implicit before. Some type casts to `ID *` were removed. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D5558
2019-08-14Cleanup: move trailing comments to avoid wrapping codeCampbell Barton
Some statements were split across multiple lines because of their trailing comments. In most cases it's clearer to put the comments above.
2019-04-17Cleanup: comment length in interfaceCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-09Cleanup: spellingCampbell Barton
2019-03-25Cleanup: use braces for interface codeCampbell Barton
2019-03-21WM: enable activate on init for wmOperatorType.propCampbell Barton
This enables popups to edit text when displayed, use for new collection popup.
2019-03-18Fix T57590: assert with zero length array buttons.Brecht Van Lommel
2019-02-27Revert "Add library-hint to datablock search menus."Bastien Montagne
This reverts commit 4669c3692cc4f69660c673ceccce2245d5b9fed8.
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-15Cleanup: comment line length (editors)Campbell Barton
Prevents clang-format wrapping text before comments.
2018-12-14Fix T59322: View Layer - Search not workingDalai Felinto
Basically uiRNACollectionSearch->but_changed was always NULL for the search templates. So skip_filter would always be true, and we would never filter. An alternative fix would be to add the following to the begin of `template_search_add_button_searchmenu`: ``` static bool always_true = true; template_search->search_data.but_changed = &always_true; ```
2018-10-31UI/Unique ID name: add library ID name if present.Bastien Montagne
Also reshuffle a bit that whole code, did some renaming, `BKE_id_to_unique_string_key()` is now using same base code (instead of using whole library filepath...), etc.
2018-10-30Add library-hint to datablock search menus.Bastien Montagne
We had those for ID templates, but it's also tremendously useful for regular ID pointers UI, since often you can get local and linked data-block with same exact name... Fetaure request from Spring team (and long due TODO...).
2018-09-27Merge branch 'master' into blender2.8Brecht Van Lommel
2018-09-27Spelling fixes in comments and descriptions, patch by luzpaz.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D3732
2018-07-26Merge branch 'master' into blender2.8Campbell Barton
2018-07-26WM: Add operator property poll callbackCampbell Barton
This allows operators to filter out properties from the auto-generated draw functions. Some custom draw functions can move to using this.