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-07-19UI: Port view item features to base class, merge view item button typesJulian Eisel
No user visible changes expected. Merges the tree row and grid tile button types, which were mostly doing the same things. The idea is that there is a button type for highlighting, as well as supporting general view item features (e.g. renaming, drag/drop, etc.). So instead there is a view item button type now. Also ports view item features like renaming, custom context menus, drag controllers and drop controllers to `ui::AbstractViewItem` (the new base class for all view items). This should be quite an improvement because: - Merges code that was duplicated over view items. - Mentioned features (renaming, drag & drop, ...) are much easier to implement in new view types now. Most of it comes "for free". - Further features will immediately become availalbe to all views (e.g. selection). - Simplifies APIs, there don't have to be functions for individual view item types anymore. - View item classes are split and thus less overwhelming visually. - View item buttons now share all code (drawing, handling, etc.) - We're soon running out of available button types, this commit merges two into one. I was hoping I could do this in multiple smaller commits, but things were quite intertwined so that would've taken quite some effort.
2022-06-14Fix T98715: Crash drag-dropping collection from outliner to ID propertyJulian Eisel
The value of disabled buttons shouldn't be changed through dropping onto it. Check for the disabled state in the drop operator poll, so the dragging code will change the cursor to show that dropping isn't possible at the given cursor location.
2022-06-09UI: Tooltip Edit - Copy to selected buttonAaron Carlisle
This commit changes the tool tip for the "Copy To Selected Button" operator. The exiting tool tip for this operator suggests that it will "copy property to selected objects or bones". However, it will only copies the property value to the selected objects or bones if the property already exists on the selected items. It does not copy the property. Differential Revision: https://developer.blender.org/D14528
2022-05-24Cleanup: Use new helpers for passing IDs from drag & drop to operatorsJulian Eisel
There are now some generalized helpers for passing IDs from drag & drop to operators via operator properties, mostly introduced in 917c096be6b9 and 8f79fa9c6780. These can be used in a bunch of places to reduce duplicated code and explicitly share a common solution. Side-effect: The "Name" property won't show up in the Adjust Last Operation anymore, and its value won't be remembered over multiple executions of the operator. Both were not at all useful from what I can tell, and I doubt this was done intentionally.
2022-05-23Cleanup: clarify what is scene linear color space in conversion conversionBrecht Van Lommel
* Rename ambiguous rgb to scene_linear in some places * Precompute matrices to directly go to scene instead of through XYZ * Make function signatures more consistent
2022-04-28VSE: Add precise drag and drop and strip previewsSebastian Parborg
This patch adds the drag and drop strip previews in the VSE. It also adds two new functions to the drag and drop API. 1. "draw_in_view" for callbacks that wants to draw elements in local viewport coordinates 2. "on_drag_start" that can be used for prefetching data only once at the start of the drag. Reviewed By: Julian, Campbell Differential Revision: http://developer.blender.org/D14560
2022-03-22Fix T96705: Crash when pressing F3 outside a Blender window if Developer extrasJulian Eisel
If the mouse is not hovering the window, there is no active region. This is a valid state, but the UI-list filter operator didn't account for that case.
2022-03-14Auto-generate RNA-structs declarations in `RNA_prototypes.h`Julian Eisel
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton
2022-03-11Fix out of order event handling when calling operators from gizmosCampbell Barton
Activating a gizmo used the windows eventstate which may have values newer than the event used to activate the gizmo. This meant transforms check for the key that activated transform could be incorrect. Support passing an event when calling operators to avoid this problem.
2022-03-04UI: Drag & Drop to Properties Materials PanelAzeem Bande-Ali
Support drag/drop of materials to Properties Material Slots. See D13549 for more details. Differential Revision: https://developer.blender.org/D13549 Reviewed by Julian Eisel
2022-02-22Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-22Fix T93629: Reset to defaults undoes all steps when applied twiceCampbell Barton
Reset Defaults left the undo stack in an invalid state, with the active undo step left at the previous state then it should have been. Now the buttons own undo logic is used to perform undo pushes.
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
2022-02-04Cleanup: Grammar in comments and tooltipsHans Goudey
- "own" -> "its own" - "it's" -> "its" - Use proper plural
2022-01-27Fix T95062: Outliner Library Overrides not refreshed when removing overrides.Bastien Montagne
Those operations were missing the necessary notification for the Outliner. This was also affecting RNA API of liboverrides.
2021-12-26Cleanup: Use array for BKE cursor functionsAaron Carlisle
Missed this function in rB67525b88d2e
2021-12-17Cleanup: spelling in commentsCampbell Barton
2021-12-16UI: support Copy To Selected for id-properties [GN modifier properties]Philipp Oeser
Both {key Alt} editing behavior as well as `Copy To Selected` were not working on geometry nodes modifiers (even if these matched exactly - having the same nodegroup - on multiple objects) Reason is that code checks pointer equality on the discovered properties [geometry nodes modifier properties are stored as ID properties], but these are not the same across objects (since these are fetched from NodesModifierSettings - which are different on different objects). note: if general custom properties are "API defined" on existing classes, this was working, we are getting the exact property for different IDs in this case Now be more permissive with ID properties not defined on classes in general and dont check pointer equality for them. For ID properties on specific IDs (not the ones defined on classes) this //might// be undesired (havent spotted issues though, even if equally named ID properies with different types existed -- this then simply does nothing). For geometry nodes modifiers, new code also checks if the nodegroups are the same [since generic naming "Input_XXX" is shared for all modifiers -- and starting to copy over things to unrelated modifiers is not desired here]. Fixes T93983. Maniphest Tasks: T93983 Differential Revision: https://developer.blender.org/D13573
2021-12-16UI: deduplicate code for Copy To Selected and Alt-button tweakingPhilipp Oeser
This resolves an old TODO to deduplicate code in copy_to_selected_button & ui_selectcontext_begin. This is also in hindsight of adding id-property support [incl. Geometry Nodes modifier properties] for this in the next commit. No behavior change expected here. ref T93983 & D13573
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-12-02Fix T93410: Crash hiding a region from Python used by a popoverCampbell Barton
Close all active buttons when hiding a region as this can be called from Python a popover is open from that region. Failure to do this causes the popover to read from the freed button. Also rename UI_screen_free_active_but to UI_screen_free_active_but_highlight since it only frees highlighted buttons.
2021-11-25Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
2021-11-25Fix T93274: Assigning asset catalog doesn't mark file as modifiedSybren A. Stüvel
Assigning a catalog to an asset via drag-and-drop in the asset browser now creates an undo step. Not only does this allow undoing the action, it also tags the blend file as modified. Reviewed by: Severin Differential Revision: https://developer.blender.org/D13370
2021-11-24Context: add accessors returning selected actions for animation editors.Alexander Gavrilov
Add a new 'selected_visible_actions' property to allow querying actions that are selected in animation related editors for use in UI and operators. The 'selected_editable_actions' variant excludes linked actions (the only reason an action can be read-only). In the Action and Shape Key editors there is only one action that is specified by the field at the top of the editor. In Dope Sheet it scans the channel rows and returns all actions related to the selected items. This includes summary items for actions and groups. In Graph Editor, it lists actions associated with selected curves. The new property is also used for Copy To Selected and Alt-Click. Ref D11803
2021-11-03UI: 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-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