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-10-27UI: Refactor how dragging onto text buttons works, fixing issuesJulian Eisel
There was a bunch of special handling to support dropping data-blocks onto string or search-menu buttons, to change the value of these. This refactor makes that case use the normal drop-box design, where an operator is executed on drop that gets input properties set by the drop-box. This should also make it easier to add support for dragging assets into these buttons. In addition this fixes an issue: Two tooltips were shown when dragging assets over text buttons. None should be shown, because this isn't supported.
2021-10-21Cleanup: Use array as a parameter for event x/y functionsAaron Carlisle
This change simplifies the parameter list for these functions and reduces the chance of typos mixing up array indices. Reviewed By: campbellbarton Ref D12950
2021-10-20Cleanup: use an array for wmEvent cursor position variablesAaron Carlisle
Use arrays for wmEvent coordinates, this quiets warnings with GCC11. - `x, y` -> `xy`. - `prevx, prevy` -> `prev_xy`. - `prevclickx, prevclicky` -> `prev_click_xy`. There is still some cleanup such as using `copy_v2_v2_int()`, this can be done separately. Reviewed By: campbellbarton, Severin Ref D12901
2021-10-20Tracking: support editing all selected tracksPhilipp Oeser
This patch adds a "selected_movieclip_tracks" context member and enables editing properties of multiple selected tracks via the usual Alt-click editing (as well as the "Copy To Selected" operator). Both use UI_context_copy_to_selected_list() to gather a list of other selected items [which are now taken via said new context member]. Strictly speaking, this could be done without the context member as well [just gathering other selected tracks in UI_context_copy_to_selected_list() without relying on a context member], but this might come in handy in other places (e.g. Addons). note: some could be desired for markers (e.g. editing pattern/search areas of all selected track markers, but since this is burried in a uiTemplate, this is a bit more work for another patch). Differential Revision: https://developer.blender.org/D12923
2021-10-08UI: Add context menu support for tree-view itemsJulian Eisel
Tree-view items can now easily define their own context menu. This works by overriding the `ui::AbstractTreeViewItem::build_context_menu()` function. See the documentation: https://wiki.blender.org/wiki/Source/Interface/Views#Context_Menus Consistently with the Outliner and File Browser, the right-clicked item also gets activated. This makes sure the correct context is set for the operators and makes it clear to the user which item is operated on. An operator to rename the active item is also added, which is something you'd typically want to put in the context menu as well.
2021-09-30UI: Support easy dropping into/onto rows in new tree-view APIJulian Eisel
Adds an easy way to add drop support for tree-view rows. Most of the work is handled by the tree-view UI code. The tree items can simply override a few functions (`can_drop()`, `on_drop()`, `drop_tooltip()`) to implement their custom drop behavior. While dragging over a tree-view item that can be dropped into/onto, the item can show a custom and dynamic tooltip explaining what's gonna happen on drop. This isn't used yet, but will soon be for asset catalogs. See documentation here: https://wiki.blender.org/wiki/Source/Interface/Views#Further_Customizations
2021-09-29Texts in Outliner dont activatePhilipp Oeser
Texts in Outliner dont activate on selecting (Text Editor did not change to selected text) which is a bit inconsistent to other ID types. ref T90862 Maniphest Tasks: T90862 Differential Revision: https://developer.blender.org/D12412
2021-08-03Cleanup: interface, reduce indentation of copy_to_selected_button()Sybren A. Stüvel
Reduce cognitive complexity of `copy_to_selected_button()` by flipping conditions, returning early, and using `continue`. No functional changes.
2021-08-03Cleanup: use C++ comments or 'if 0' for commented codeCampbell Barton
2021-08-02WindowManager: Support Dynamic tooltips when dragging.Jeroen Bakker
Originally the operator name was drawn next to the dragging content. After that there was an option to add custom, static text with the dragging content. This patch allows dynamic text to be drawn. The custom text was implemented as out parameter of the poll function what made the code unclear. This patch introduces a tooltip function that separates tooltip generation from the poll function. NOTE: the text should always be returned in its own memory block. This block will be freed after it is copied in the drag struct. Reviewed By: Severin Differential Revision: https://developer.blender.org/D12104
2021-07-21Cleanup: replace BLI_assert(0 && "text") with BLI_assert_msgCampbell Barton
2021-07-15UI: Support pressing Ctrl+F over UI lists to searchJulian Eisel
Adds an operator invoked by default with Ctrl+F that while hovering a UI list, opens the search field of the list and enables text input for it. With this commit the search button may actually be out of view after Ctrl+F still. The following commit adds auto-scroll to solve that. A downside is that in the Properties, there also is Ctrl+F to start the editor-wide search. That's not unusual in Blender though (e.g. scolling with the mouse over a UI list also scrolls the list, not the region).
2021-07-05Cleanup: spelling in commentsCampbell Barton
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-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-04-30Cleanup: use early return in edittranslation_execCampbell Barton
2021-04-26Fix T87771: Immediate Crash on "Edit Source" in CompositorPhilipp Oeser
Caused by {rB278011e44d43}. Framebuffer management since above commit now seems to require region bind/unbind in for the operator to be able to redraw correctly without using the same framebuffer in multiple contexts. Maniphest Tasks: T87771 Differential Revision: https://developer.blender.org/D11084
2021-04-08Text Editor: don't force other views to follow the cursorCampbell Barton
While the existing behavior worked as intended, it wasn't possible to have two views on the same file at different locations. Since there isn't much use in having two views open at the same location allow one view to be at a different scroll location. UI edit-source and selecting a text data block now need explicit calls to scroll to the cursor location. Resolves T87284
2021-02-18Fix failing "Edit Source" (asserts) while number slider was visibleJulian Eisel
E.g. steps to reproduce: * Enter Vertex Paint mode * In the tool settings, right-click > "Edit Source" When creating a number slider via `layout.prop(..., slider=True)`, the UI code would reallocate the number button to be a number-slider button. That's because we now actually have different button data-structures for these (see e6f0b60c2e911). The edit source code stored data based on the button pointers, which didn't get updated after changing the type. The fix just adds this updating.
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-13UI: Revert design changes to data-block selector for the 2.92 releaseJulian Eisel
Partially reverts 2250b5cefee7. Removing the user count and fake user count icons was controversial (which was expected) and there are a few further changes needed, that won't make it in time for the release, see D9946. While there is a design to bring back the user count and fake user indicators, a new design idea was proposed that the UI team wants to follow. This came too late for the 2.92 release, the new design is targeted at the 2.93 release now. Meanwhile, UI team decision was to simply revert the design changes. The new design is being worked on in https://developer.blender.org/T84669. Note that this commit does not revert some internal changes done in 2250b5cefee7. Namely the introduction of `ed_util_ops.c` and data-block operators in there. These will still be needed in the new design.
2020-12-18UI: Redesigned data-block selectorsJulian Eisel
The previous design is rather old and has a couple of problems: * Scalability: The current solution of adding little icon buttons next to the data-block name field doesn't scale well. It only works if there's a small number of operations. We need to be able to place more items there for better data-block management. Especially with the introduction of library overrides. * Discoverability: It's not obvious what some of the icons do. They appear and disappear, but it's not obvious why some are available at times and others not. * Unclear Status: Currently their library status (linked, indirectly linked, broken link, library override) isn't really clear. * Unusual behavior: Some of the icon buttons allow Shift or Ctrl clicking to invoke alternative behaviors. This is not a usual pattern in Blender. This patch does the following changes: * Adds a menu to the right of the name button to access all kinds of operations (create, delete, unlink, user management, library overrides, etc). * Make good use of the "disabled hint" for tooltips, to explain why buttons are disabled. The UI team wants to establish this as a good practise. * Use superimposed icons for duplicate and unlink, rather than extra buttons (uses less space, looks less distracting and is a nice + consistent design language). * Remove fake user and user count button, they are available from the menu now. * Support tooltips for superimposed icons (committed mouse hover feedback to master already). * Slightly increase size of the name button - it was already a bit small before, and the move from real buttons to superimposed icons reduces usable space for the name itself. * More clearly differentiate between duplicate and creating a new data-block. The latter is only available in the menu. * Display library status icon on the left (linked, missing library, overridden, asset) * Disables "Make Single User" button - in review we weren't sure if there are good use-cases for it, so better to see if we can remove it. Note that I do expect some aspects of this design to change still. I think some changes are problematic, but others disagreed. I will open a feedback thread on devtalk to see what others think. Differential Revision: https://developer.blender.org/D8554 Reviewed by: Bastien Montagne Design discussed and agreed on with the UI team, also see T79959.
2020-12-10Cleanup: avoid '_ln' suffixCampbell Barton
Use '_len' or '_line_number'.
2020-11-23Fix T82849: Assert When Unlinking "Edit Source" Text Data-block.Bastien Montagne
Simplify and sanitize handling of usercounts for Text IDs generated trhough `BKE_text_load_ex`.
2020-10-15Fix T76597: Support Keyframe: Copy To SelectedWayde Moss
Reviewed By: Sybren, Luciano Muñoz Sessarego Differential Revision: https://developer.blender.org/D7783
2020-10-13Fix T81674: LibOverride: 'Define Override' UI operation can crash.Bastien Montagne
Case where RNA is not able to generate a proper path for a property was not taken into account properly.
2020-09-02Cleanup: use bool instead of int in various placesJacques Lucke
2020-08-28Fix T80195: crash when invoking tooltips on MacOSGermano Cavalcante
Problem introduced in rBadd48c007428. `UI_but_string_info_get` can change the value of the args.
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 structs for search buttons and decoratorsJulian Eisel
The current on-size-fits-all `uiBut` creates quite a mess, where it's hard to reason about which members are free for use, under which conditions they are used and how. `uiBut` also has members that aren't used at times, violating the "don't pay for what you don't use" principle. To address this, we want to move to typed buttons, where `uiBut` is just a base struct and each type extends it as needed. That structures data better and type specific data is only available if it's actually used by a button type. Two trade-offs: * Many casts to the derived type have to be done. * Sometimes we change the button type after it's created. So I had to add logic to reallocate the button for use with the new, possibly derived struct. Ideally that wouldn't be needed, but for now that's what we have. Part of T74432. Differential Revision: https://developer.blender.org/D7610 Reviewed by: Brecht Van Lommel, Campbell Barton
2020-08-06UI: Fixes and small improvements to some labels and UI messagesYevgeny Makarov
Small tweaks to make labels and texts more correct, consistent and polished. Reviewed by: Aaron Carlisle, Julian Eisel Differential Revision: https://developer.blender.org/D8346
2020-07-16LibOverride: Fix getting proper RNA path and ID from embedded ones.Bastien Montagne
Master collections and root node trees should now be working as expected in that regard.
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-30LibOverride: Add necessary bits in RNA to deal with embedded IDs paths.Bastien Montagne
Note that this code is rather rough and slightly hacky, a proper solution needs to be designed at some point probably, but for now this should work fine. As usual, master collections and root node trees remain TODO for now.
2020-06-30Cleanup: Use unsigned int when for enum values, instead of signed int.Bastien Montagne
2020-06-30Cleanup: LibOverride: Replace raw pointers checks by proper macros.Bastien Montagne
This is cleaner, but also crucial to avoid weird issues when behaviors of those checks are modified...
2020-06-23Cleanup: rename 'name' to 'filepath' for DNA typesCampbell Barton
Using 'name' for the full path of a file reads badly, especially when id.name is used in related code.
2020-06-09Fix T77148: Crash changing multiple values for sequencer stripsCampbell Barton
This was caused by assuming all strips were the same type.
2020-05-12Fix T76635: Clicking the text button X in a pop-up doesn't clearJulian Eisel
In this case giving `CTX_wm_menu()` priority over `CTX_wm_region()` is all that's needed and makes sense (since we want exactly the hovered button, not some other active button in the region/menu hierarchy). The situation with pop-ups is still tricky, see T73565. But as a first step it's probably good to let functions be more explicit about what they want when querying UI context. So I added a variation of a UI-context function for cases like this.
2020-05-07Cleanup: split button search callbacks into their own structCampbell Barton
2020-04-03Cleanup: Rename bScreen variables from sc/scr to screenJulian Eisel
Part of T74432. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-04-03Cleanup: Rename ScrArea variables from sa to areaJulian Eisel
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432. Now the area and region naming conventions should be less confusing. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-04-03Cleanup: Continue renaming ARegion variables from ar to regionJulian Eisel
Continuation of b2ee1770d4c3, now non-single word variables are also renamed. Part of T74432. Also ran clang-format on affected files.
2020-04-01Fix T66494: Alt+ clicking (assign to all selected) does not work for NLAPhilipp Oeser
strips This uses the new "selected_nla_strips" context member in UI_context_copy_to_selected_list(). bonus: this also makes the "Copy To Selected" button operator [in the button context menu] work for anything NLA Strip related. Maniphest Tasks: T66494 Differential Revision: https://developer.blender.org/D7281
2020-03-25Cleanup: use 'r_' prefix for output argumentsCampbell Barton
Also pass some args as 'const'.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-06Cleanup: Rename ARegion variables from ar to regionJulian Eisel
The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files.
2020-03-06Cleanup: Reduce context usage in UI functionsJulian Eisel
Part of https://developer.blender.org/T74429. There's a chance that this causes some issues becaue in some cases we change from getting the window from context to getting it from somewhere else.
2020-03-04Fix T74434: Video Sequencer: Alt+ clicking (assign to all selected) doesPhilipp Oeser
not work for unlocking Special case for when we do this on "lock": - locked sequences are not in "selected_editable_sequences" - use "selected_sequences" in that case Maniphest Tasks: T74434 Differential Revision: https://developer.blender.org/D7023