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-04-13WM: improve logging for handling operatorsCampbell Barton
- Add logging for CLICK_DRAG event handling to debug drag events. - Use logging API for reporting the key-map, operator and event. This command now prints useful information for investigating key-map and event handling issues: blender --log "wm.handler.*" --log-level 4
2022-03-29Fix T96701: RMB select fails to show gizmo on mouse button releaseCampbell Barton
Regression in [0] which removed a special check when tweak events ended. Add a similar check for drag events that runs drag is disabled in the main event handling loop. [0]: 4986f718482b061082936f1f6aa13929741093a2
2022-03-25XR: Fix crash on executing some action operatorsPeter Kim
Since the XR area does not have any region geometry, hud updates from operators would cause invalid access when updating region sizes.
2022-03-23Event System: improve handling of unknown keysCampbell Barton
When converting ghost keys to Blender's event system: - All keys that aren't part of the GHOST_TKey enum map to EVENT_NONE (ignored), note that it's an internal error if the value of key isn't a known value. - Modify the switch statement so any missing members of GHOST_TKey warn at compile time (GCC & Clang only). - GHOST_kKeyUnknown maps to EVT_UNKNOWNKEY. We could ignore this key, changing can be evaluated separately.
2022-03-23Event System: ignore keys such as print-screen & num-lockCampbell Barton
Avoid adding events with their type set to EVENT_NONE as these can't be categorized usefully (keyboard/mouse/NDOF ... etc), and add an extra case that needs to be accounted for. Adding these events seems to be an unintentional change from [0], these keys used to be ignored in 2.4x. [0]: a1c8543f2acd7086d412cb794b32f96794b00659
2022-03-23Fix T96712: Debug Assert with PrintScrn & ScrollLock keysCampbell Barton
Caused by 08d8eee006f7e2a7ac05ef691bbaee230cbfbe5a.
2022-03-21Cleanup: cursor motion events now have value set to KM_NOTHINGCampbell Barton
In some cases value of cursor motion events was set from the last event written to the wmWindow.eventstate. Avoid potential errors by ensuring cursor motion events always have their value set to KM_NOTHING.
2022-03-11Event System: limit early evaluation of drag actions to mouse buttonsCampbell Barton
Change early drag evaluation added in 1f1dcf41d51a03150ee38f220c590f8715b11e88 to only apply to drag events from mouse buttons. Otherwise pressing two keyboard keys at one would create a drag event for the first pressed key. While this didn't cause any bugs as far as I know, this behavior makes most sense for drags that come from cursor input.
2022-03-11Event System: only set press values in win->eventstateCampbell Barton
Only set press events in the windows eventstate, not the current event since it's not useful for these to be set current events press values. This makes it possible for a press event to access values for the previous press.
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-10Event System: key-press while dragging now activates drag firstCampbell Barton
When dragging with a large threshold (using a tablet for example), it's possible to press another key before the drag threshold is reached. So tweaking then pressing X would show the delete popup instead of transforming along the X-axis. Now key presses while dragging cause the drag event to be evaluated before the key press. Note that to properly base the mouse-move event on the previous state the last handled event is now stored in the window. Without this the inserted mouse-move event may contain invalid values from the next event (it's modifier state or other `prev_*` values). Requested by @JulienKaspar.
2022-03-10Fix T96279: 'Emulate 3 button mouse' fails to emulate MMBCampbell Barton
Regression in 08d8eee006f7e2a7ac05ef691bbaee230cbfbe5a caused emulate-middle mouse to work once, clearing the modifier key. Now the modifier key from emulated mouse events is never stored in the windows event-state.
2022-03-10Cleanup: de-duplicate event customdata freeing logicCampbell Barton
2022-03-09Cleanup: use ELEM macroCampbell Barton
2022-03-09Cleanup: rename wmEvent.prev_click_* to prev_press_*Campbell Barton
At the time of naming these members only some event types generated click events so it made some sense to differentiate a click. Now all buttons support click & drag it's more logical to use the prefix "prev_press_" as any press event will set these values. Also update doc-strings.
2022-03-09Event System: drag events no longer default to the drag start locationCampbell Barton
This avoids transform jumping which is a problem when tweaking values a small amount. A fix for T40549 was made box-select used the location when the key was pressed. While it's important for box-select or any operator where it's expected the drag-start location is used, this is only needed in some cases. Since the event stores the click location and the current location, no longer overwrite the events real location. Operators that depend on using the drag-start can use this location if they need. In some cases the region relative cursor location (Event.mval) now needs to be calculated based on the click location. - Added `WM_event_drag_start_mval` for convenient access to the region relative drag-start location (for drag events). - Added `WM_event_drag_start_xy` for window relative coordinates. - Added Python property Event.mouse_prev_click_x/y Resolves T93599. Reviewed By: Severin Ref D14213
2022-03-08Event System: click/click-drag support for NDOF buttonsCampbell Barton
Support this for completeness, as it's simpler to support click-drag for all events types that support press/release instead of having to document which kinds buttons support click-drag.
2022-03-08Event System: add ISKEYBOARD_OR_BUTTON macroCampbell Barton
This simplifies checking for event types that support press & release.
2022-03-08Event System: refactor click detection into functionCampbell Barton
Also simplify modifier & keymodifier assignment.
2022-03-04Cleanup: remove outdated references to tweakCampbell Barton
2022-03-03Cleanup: comments in wm_event_system.cCampbell Barton
2022-03-03Event System: use more thoroughly tested logic for click-drag eventsCampbell Barton
No functional changes, largely restoring old logic & removing the need for workarounds. Reverts: - 13b6cec039681db40e677463aa9fdff6d55896aa. - aa71414dfca7f301e101cce3e72551e7529290ea (partially).
2022-03-03Cleanup: remove references to key-map modifier values denoting orderCampbell Barton
This feature was never exposed to users.
2022-03-02Fix T96123: Crash when click-dragging across the visibility iconsCampbell Barton
Partially revert aa71414dfca7f301e101cce3e72551e7529290ea This attempted have the click-drag event compatible with old tweak events, but needs to be re-thought since it caused events to be handled in unexpected situations.
2022-03-02Fix releasing modifier keys suppressing drag eventsCampbell Barton
Always use event.prev_click_type since this is never set on key-release, which could still interrupt dragging (box selecting for example).
2022-03-02Cleanup: misleading code from aa71414dfca7f301e101cce3e72551e7529290Campbell Barton
This branch was previously run when the action had been handled, since action checks were removed it was running. This assignment does nothing but shouldn't be kept.
2022-03-02Docs: document the use_axis_view argumeht to view_roll_angleCampbell Barton
Also remove event print left in by accident.
2022-03-02Event System: remove tweak events in favor of click-dragCampbell Barton
Supporting two kinds of dragging is redundant, remove tweak events as they only supported 3 mouse buttons and added complexity from using the 'value' to store directions. Support only click-drag events (KM_CLICK_DRAG) which can be used with any keyboard or mouse button. Details: - A "direction" member has been added to keymap items and events which can be used when the event value is set to KM_CLICK_DRAG. - Keymap items are version patched. - Loading older key-maps are also updated. - Currently the key-maps stored in ./release/scripts/presets/keyconfig/ still reference tweak events & need updating. For now they are updated on load. Note that in general this wont impact add-ons as modal operators don't receive tweak events. Reviewed By: brecht Ref D14214
2022-03-02Fix click-drag events for dragging markersCampbell Barton
Clicking and dragging markers accumulates flags from multiple operators in a way that can't be interpreted when combine. Follow tweak behavior for cancelling click-drag events.
2022-03-02Fix ignored click-drag events when operators pass-through & finishedCampbell Barton
Replacing tweak key-map items with click-drag caused selection in the graph/sequencer/node editors to ignore drag events (all uses of WM_generic_select_modal). Operators that return OPERATOR_PASS_THROUGH | OPERATOR_FINISHED result in the event loop considering the event as being handled. This stopped WM_CLICK_DRAG events from being generated which is not the case for tweak events. As click-drag is intended to be compatible with tweak events, accept drag events when WM_HANDLER_BREAK isn't set or when wm_action_not_handled returns true.
2022-03-02Merge branch 'blender-v3.1-release'Germano Cavalcante
2022-03-02Fix T95608: Mac issues with drag drop on multi-monitorGermano Cavalcante
Mousemove events are sent to windows. In Windows OS, almost all mousemove events are sent to the window whose mouse cursor is over. On MacOS, the window with mousemove events is always the active window. It doesn't matter if the mouse cursor is inside or outside the window. So, in order for non-active windows to also have events, `WM_window_find_under_cursor` is called to find those windows and send the same events. The problem is that to find the window, `WM_window_find_under_cursor` only has the mouse coordinates available, it doesn't differentiate which monitor these coordinates came from. So the mouse on one monitor may incorrectly send events to a window on another monitor. The solution used is to use a native API on Mac to detect the window under the cursor. For Windows and Linux nothing has changed. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14197
2022-03-01Fix incorrect drag-event threshold when releasing modifiers earlyCampbell Barton
db4313610cab18933c1b1b1348720ea241b9d91e added support for modifier keys to be released while dragging. The key release events set wmEvent.prev_type which is used select the drag threshold, causing the wrong threshold to be used. Add wmEvent.prev_click_type which is only set when the drag begins.
2022-03-01Cleanup: move Event.is_repeat & is_direction_inverted to flagsCampbell Barton
Use a flag for events to avoid adding struct members every time a new kind of tag is needed - so events remain small. This also simplifies copying settings as flags can be copied at once with a mask.
2022-02-28Event System: drag events now use modifier state on drag startCampbell Barton
Now drag & tweak can have modifier keys to be released while dragging. without this, modifier keys needs to be held which is more noticeable for tablet input or whenever the drag threshold is set to a large value. Resolves T89989.
2022-02-25Cleanup: use flags for wmEvent modifier keysCampbell Barton
Using flags makes checking multiple modifiers at once more convenient and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag which have been removed. It also simplifies checking if modifier keys have changed.
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-03Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-03Fix T66913: undo after frame-change doesn't refresh properlyCampbell Barton
Use the ID.recalc flag to detect when updates after frame-change is needed. Since comparing the last calculated frame doesn't take undo into account (see code-comment for details). `ID_RECALC_AUDIO_SEEK` has been renamed to `ID_RECALC_FRAME_CHANGE` since this is not only related to audio however internally this flag is still categorized in `NodeType::AUDIO`. Reviewed By: sergey Ref D13942
2022-01-31Cleanup: use our own conventions for tags in commentsCampbell Barton
2022-01-28Drag & drop: Support using context of hovered button when droppingJulian Eisel
Buttons can hold context and it's very useful to use this as a way to let buttons provide context for drop operators. For example, with this D13549 can make the material slot list set the material-slot pointer for each row, and the drop operator can just query that.
2022-01-27UX: Prevent click-through panels and used header areaJulian Eisel
Does two main changes: * Handle regions in the order as visible on screen. Practically this just means handling overlapping regions before non-overlapping ones. * Don't handle any other regions after having found one containing the mouse pointer. Fixes: T94016, T91538, T91579, T71899 (and a whole bunch of duplicates) Addresses: T92364 Differential Revision: https://developer.blender.org/D13539 Reviewed by: Campbell Barton
2022-01-27Event System: Add debug sanity check "always pass" eventsJulian Eisel
Asserts that such events actually always lead to a handler return value that actually keeps the event passing. Reviewed by Campbell Barton as part of https://developer.blender.org/D13539.
2022-01-26Performance: Remap multiple items in UIJeroen Bakker
During sprite fright loading of complex scenes would spend a long time in remapping ID's The remapping process is done on a per ID instance that resulted in a very time consuming process that goes over every possible ID reference to find out if it needs to be updated. If there are N of references to ID blocks and there are M ID blocks that needed to be remapped it would take N*M checks. These checks are scattered around the place and memory. Each reference would only be updated at most once, but most of the time no update is needed at all. Idea: By grouping the changes together will reduce the number of checks resulting in improved performance. This would only require N checks. Additional benefits is improved data locality as data is only loaded once in the L2 cache. It has be implemented for the resyncing process and UI editors. On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went from 170 seconds to 145 seconds (during hotspot recording). After this patch has been applied we could add similar approach to references (references between data blocks) and functionality (tagged deletion). In my understanding this could reduce the resyncing process to less than a second. Opening the village production file between 10 and 20 seconds. Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`) * Master {F12769210 size=full} * This patch {F12769211 size=full} Reviewed By: mont29 Maniphest Tasks: T94185 Differential Revision: https://developer.blender.org/D13615
2022-01-25Revert "Performance: Remap multiple items in UI"Jeroen Bakker
This reverts commit 948211679f2a0681421160be0d3b90f507bc0be7. This commit introduced some regressions in the test suite. As this change is a core part of blender Bastien and I decided to revert it as the solution isn't clear and needs more investigation. The following tests FAILED: 62 - blendfile_liblink (SEGFAULT) 63 - blendfile_library_overrides (SEGFAULT) It fails in (id_us_ensure_real)
2022-01-25Performance: Remap multiple items in UIJeroen Bakker
During sprite fright loading of complex scenes would spend a long time in remapping ID's The remapping process is done on a per ID instance that resulted in a very time consuming process that goes over every possible ID reference to find out if it needs to be updated. If there are N of references to ID blocks and there are M ID blocks that needed to be remapped it would take N*M checks. These checks are scattered around the place and memory. Each reference would only be updated at most once, but most of the time no update is needed at all. Idea: By grouping the changes together will reduce the number of checks resulting in improved performance. This would only require N checks. Additional benefits is improved data locality as data is only loaded once in the L2 cache. It has be implemented for the resyncing process and UI editors. On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went from 170 seconds to 145 seconds (during hotspot recording). After this patch has been applied we could add similar approach to references (references between data blocks) and functionality (tagged deletion). In my understanding this could reduce the resyncing process to less than a second. Opening the village production file between 10 and 20 seconds. Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`) * Master {F12769210 size=full} * This patch {F12769211 size=full} Reviewed By: mont29 Maniphest Tasks: T94185 Differential Revision: https://developer.blender.org/D13615
2022-01-10Cleanup: typos in comments, remove libnumaapi referenceCampbell Barton
2021-12-25Cleanup: Use array for BKE cursor functionsAaron Carlisle
Differential Revision: https://developer.blender.org/D12962
2021-12-14Fix T93649: Blender freezes when saving with active VR sessionJulian Eisel
Dead-lock when VR viewport drawing and depsgraph updates would fight for the draw-manager GL lock. This didn't usually cause issues because the depsgraph would be evaluated at this point already, except in rare exceptions like after file writing. Fix this by ensuring the XR surface gets its depsgraph updated after handling notifiers, which is where regular windows also do the depsgraph updating.
2021-12-08Cleanup: move public doc-strings into headers for 'windowmanager'Campbell Barton
Ref T92709