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-03Cleanup: Move interface View2D files to C++Hans Goudey
Similar to 4537eb0c3b1678a6235
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-02-24Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-24Fix 2D view NDOF panning requiring both axes to be non-zeroCampbell Barton
Possible fix for T86592.
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 'editors'Campbell Barton
Ref T92709
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-09-21Cleanup: Silence unused variable warningJulian Eisel
2021-09-21VSE strip thumbnailsAditya Y Jeppu
Draw thumbnails as strip overlay. This works for movie and image strips. To draw thumbnails, this overlay has to be enabled and strips must be tall enough. The thumbnails are loaded from source file using separate thread and stored in cache. Drawing code uses only images stored in cache, and if any is missing, background rendering job is started. If job can not render thumbnail, to prevent endless loop of creating job for missing image it sets `SEQ_FLAG_SKIP_THUMBNAILS` bit of `Sequence` flag. To prevent visual glitches during timeline panning and zooming, `View2D` flag `V2D_IS_NAVIGATING` is implemented. If bit is set, drawing code will look for set of evenly distributed thumbnails that should be guaranteed to exist and also set of previously displayed thumbnails. Due to volatile nature of cache these thumbnails can be missing anyway, in which case no new thumbnails will be drawn for particular strip. Cache capacity is limited to 5000 thumbnails and performs cleanup of non visible images when limit is reached. ref T89143 Reviewed By: ISS Differential Revision: https://developer.blender.org/D12266
2021-07-07Cleanup: 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-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-16Edge-scrolling for node editorLukas Tönne
Starts scrolling when dragging a node or node link and going outside the current window. Largely copied from the VIEW2D_OT_edge_pan operator. Edge panning operator customdata and supporting functions now in UI_view2d.h, so they could be used by operators in other editor libraries. The VIEW2D_OT_edge_pan operator also uses this customdata and shared functions now. Operators properties can be used to configure edge panning margins and speed for each use case, rather than using hardcoded values. The speed function for edge panning has been tweaked somewhat: * "Speed per pixel" has been replaced with a "speed ramp" distance. This is more intuitive and also creates an upper bound for the speed, which can otherwise become extreme with large cursor distance. * "Max speed" is reached at the end of the speed ramp. * Padding the region inside and outside is applied as before, but both values are operator properties now. Node transform operator also supports edge panning. This requires an offset for changes in the view2d rect, otherwise nodes are "stuck" to the original view. Transform operator had cursor wrapping categorically enabled, but this gets quite confusing with the edge scrolling mechanism. A new TransInfo option T_NO_CURSOR_WRAP has been introduced to disable this behavior. The double negative is a bit annoying, but want to avoid affecting the existing transform modes, so by default it should still set the OP_IS_MODAL_GRAB_CURSOR flag (which then sets the WM_CURSOR_WRAP_XY flag during modal execution). Reviewed By: HooglyBoogly, JacquesLucke Differential Revision: https://developer.blender.org/D11073
2021-05-21Cleanup: spellingLeon Zandman
Includes fixes to misspelled function names. Ref D11280
2021-02-16Cleanup: spellingCampbell Barton
2021-02-05Cleanup: rename USER_ZOOM_{CONT->CONTINUE} improve commentsCampbell Barton
USER_ZOOM_CONT only had comments saying this was 'oldstyle', remove these comments, add brief explanations of the zoom style in the enum.
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-20Fix T73575: Zooming out a lot faster than zooming inYevgeny Makarov
- Zooming out a lot faster than zooming in, it had the wrong aspect ratio, make all the preparations with the factors instead of deltas. - Improved following the `zoom_invert` (should not apply to `MOUSEZOOM`) and "trackpad natural scroll" preferences. - `zoomfac` adjustment, same as in `view_zoomdrag_modal`. Ref D8686
2021-01-20Fix T65837: Zoom Axis is not working in the Node EditorYevgeny Makarov
It was already fixed for the mouse in bcda8cc89b88c999ff64edcc19973d6289bcbf2a, T65837 now the same logic is applied for the track-pad. Ref D8685
2021-01-04Cleanup: use const variablesCampbell Barton
2020-12-13Cleanup: Reduce variable scope in view_2d_ops.cHans Goudey
2020-11-06Cleanup: use ELEM macroCampbell Barton
2020-10-29Merge branch 'blender-v2.91-release'Julian Eisel
2020-10-29Fix Zoom to Mouse Position ignored when zooming outJulian Eisel
Own mistake in rB3a1cf838ca09. Thanks to @jenkm for pointing this out.
2020-10-29Fix for T78211: Trackpad Zoom to Mouse Position ErrorYevgeny Makarov
When using a trackpad Zoom to Mouse Position would always zoom to center of canvas. Differential Revision: https://developer.blender.org/D8683 Reviewed by Brecht Van Lommel
2020-10-29Fix for T65714: Pinch Zooming Crash using Mac TrackpadYevgeny Makarov
Ensure that Zoom does not crash on Mac Trackpad by checking for existence of Continuous Zoom timer. Differential Revision: https://developer.blender.org/D8682 Reviewed by Julian Eisel
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-10-03Cleanup: Remove duplicated View2D pan polling logicJulian Eisel
Same as 21fc4ae20692, but for view panning this time. Also had to set the poll callbacks still in this case.
2020-10-03Revert part of previous commitJulian Eisel
The change to the `poll()` callback was actually incorrect. But also reduandant, since the function is actually already executed in the operator.
2020-10-03Fix compile error when compiling with WITH_INPUT_NDOF after View2D changesJulian Eisel
Actually, fixes compile error and an incorrect poll. Caused by 21fc4ae20692 and 3a1cf838ca09. The poll has to perfrom the `view_zoom_poll()` logic to ensure correct context.
2020-10-03Fix issues with calling View2D zoom operators in an `EXEC` contextJulian Eisel
Multiple related issues: * `view_zoomdrag_exec()` required `view_zoomdrag_init()` to be called first to set up data. Can now easily be done in the `_exec()` function as well though. * Because of that the operators could not be called in an `EXEC_` context (e.g. `EXEC_REGION_WIN`). * With "Zoom to Mouse Position" enabled, zooming from a menu or script would zoom to the mouse position. That should only happen if the operators are called directly in the editor.
2020-10-03Cleanup: Remove redundant View2D operator poll checkJulian Eisel
The poll would already be executed as operator callback, this check was redundant. Also see previous commit.
2020-10-03Cleanup: Remove duplicated View2D zoom polling logicJulian Eisel
`view_zoomdrag_init()` would perform a number of sanity checks that `view_zoom_poll()` already executed. The design of operators forsees that (non-expensive) context sanity checks are done by the `poll()` callbacks, and the execution callbacks can then just assume that happened. No reason to be overly pedantic, we don't do that elsewhere either. Note that this code is from the earliest days of an operator design. So it's not surprising that it wasn't using the design "properly".
2020-09-09Cleanup: reduce variable scopeJacques Lucke
2020-09-02Cleanup: use bool instead of int in various placesJacques Lucke
2020-08-26Cleanup: use const variables in interface codeCampbell Barton
2020-08-18Merge branch 'blender-v2.90-release' into masterCampbell Barton
2020-08-18Fix T79787: orbit/zoom sensitivity depends on line-widthCampbell Barton
Use 'dpi_fac' instead of 'pixelsize' to scale input sensitivity based on the interface scale. Also use dpi_fac for view zoom operator. Thanks to @ISS for investigating.
2020-08-13View2D: Centralize handling of changes to v2d->curSergey Sharybin
Currently there are no functional changes, preparing code to add more functionality which is to be run from navigation/zoom operators.
2020-08-01Cleanup: use term init instead of initialize/initialiseCampbell Barton
The abbreviation 'init' is brief, unambiguous and already used in thousands of places, also initialize is often accidentally written with British spelling.
2020-07-21UI: Add an outer boundary for edge panning, use in outlinerHans Goudey
Currently if you drag and drop an item from the outliner elsewhere in the Blender window, the outliner will scroll the entire time, even if the mouse is far away. This commit adds optional behavior for the edge pan operator that makes it only act if the mouse is close enough to the region. Differential Revision: https://developer.blender.org/D8193
2020-07-07Cleanup: spellingCampbell Barton
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-23Fix T78146: Crash using scroll barsCampbell Barton
Regression in 2fdca5bd1981c
2020-06-22Refactoring: View2DScrollers memory allocationJeroen Bakker
View2DScrollers used the memory manager to allocate memory. This isn't a problem but in a upcoming change the scrollers will be drawn more often than it used to (See {D8066}). To limit the number of allocations and frees this patch will use the stack for allocation. Reviewed By: Campbell Barton Differential Revision: https://developer.blender.org/D8076
2020-06-18Cleanup: redundant parenthesisCampbell Barton
2020-06-05Fix failing assert when dragging panel close to region edgeHans Goudey
Forgot to include this change from Julian Eisel @Severin in the previous commit.
2020-06-05UI: Pan 2D Region When Dragging to BoundaryHans Goudey
This adds a modal operator called Edge Pan, which is meant to run invisibly while something inside a region is being dragged. This patch applies this to dragging panels, but it can be used elsewhere too. The speed (which is defined relative to how far the mouse is beyond the boundary) and delay are easily adjustible. and the speed also increases smoothly from a start value to a max to make it feel more interactive and less robotic. Differential Revision: https://developer.blender.org/D7465
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.