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-08-26Cleanup: use booleansCampbell Barton
2022-08-24Cleanup: formatCampbell Barton
2022-08-23I18n: make workspaces translatableDamien Picard
This makes workspaces more translatable: - New Workspace menu - header - preset menus - preset entries - workspace names upon factory file template load - new workspace name upon workspace addition To properly translate those names, an extraction function for workspace names from app templates was added as well. (Do not do anything when loading a user-saved file!) Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15727
2022-08-18WM: optimize adding notifier duplication checkCampbell Barton
Use a GSet to check for duplicate notifiers, for certain Python scripts checking for duplicate notifiers added considerable overhead. This is an alternative to D15129 with fewer chances to existing logic.
2022-08-18Cleanup: de-duplicate notifier add functionCampbell Barton
2022-08-18Cleanup: early return, reduce right-shiftCampbell Barton
2022-08-17WM: update comment about window redraw for thumbnailsCampbell Barton
2022-08-17Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-17Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-17Cleanup: spelling in commentsCampbell Barton
2022-08-17Fix freed memory access checking events with debug buildsCampbell Barton
Pressing escape when rendering a viewport animation would access the freed even and crash (with ASAN enabled). Always check the context's window before the event as this is a signal a file was loaded or the window was closed (and it's events freed).
2022-08-17Fix T98462: Save Screenshot (glReadPixels) fails under WaylandCampbell Barton
Use an off-screen buffer for the screen-shot operator. Reading from the front-buffer immediately after calling swap-buffers failed for GHOST/Wayland in some cases. While EGL can request to preserve the front-buffer while drawing, this isn't always supported. So workaround the problem by avoiding use of the front-buffer entirely.
2022-08-17Cleanup: strip blank lines around comment blocksCampbell Barton
2022-08-15Introduce headless OpenGL rendering on LinuxSebastian Parborg
With this patch true headless OpenGL rendering is now possible on Linux. It changes the logic of the WITH_HEADLESS build flag. The headless backend is now always available with regular builds and Blender will try to fall back to it if it fails to initialize other backends while in background mode. The headless backend only works on Linux as EGL is not used on Mac or Windows. libepoxy does support windows and mac, so this can perhaps be remedied in the future. Reviewed By: Brecht, Jeroen, Campbell Differential Revision: http://developer.blender.org/D15555
2022-08-15GPU: replace GLEW with libepoxyChristian Rauch
With libepoxy we can choose between EGL and GLX at runtime, as well as dynamically open EGL and GLX libraries without linking to them. This will make it possible to build with Wayland, EGL, GLVND support while still running on systems that only have X11, GLX and libGL. It also paves the way for headless rendering through EGL. libepoxy is a new library dependency, and is included in the precompiled libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed. Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton and Sergey Sharybin. Ref T76428 Differential Revision: https://developer.blender.org/D15291
2022-08-15Cleanup: fix typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D15680
2022-08-12Cleanup: repeated words in commentsCampbell Barton
2022-08-12Cleanup: remove unnecessary ifdefCampbell Barton
2022-08-11Merge branch 'blender-v3.3-release'Brecht Van Lommel
2022-08-11Fix T100130: animation player crash on exitBrecht Van Lommel
GPU_exit is now expected to run within an active GPU context. Also run BLF_exit and IMB_exit first they can use GPU resources and gave ASAN errors. And remove redundant GPU_shader_free_builtin_shaders already handled by GPU_exit.
2022-08-11Fix T66088: Modifier keys ignored when the window doesn't have focusCampbell Barton
Always use modifier keys from the active window, as changes to the modifiers aren't sent to inactive windows. Also resolves modifier keys being lost on window de-activation. Activating the window again would check the previous state of the modifiers which was always cleared as of [0], now clearing is no longer needed. [0]: 472595f1d3533f143bdc84700b26f20a7b2ba1c1
2022-08-09Compositor: Rename compositor build optionOmar Emara
Currently, the compositor can be disabled using the WITH_COMPOSITOR build option. Since, we intent to always build the realtime compositor, we need to make the distinction between both compositors clear. So this patch renames the option to WITH_COMPOSITOR_CPU. Additionally, the check for the option was moved inside the compositor modules' own CMake file in preparation for the realtime compositor code. Differential Revision: https://developer.blender.org/D15622 Reviewed By: Jeroen Bakker, Ray Molenkamp
2022-08-09Cleanup: use own username in code-comment tagsCampbell Barton
2022-08-04Cleanup: Move RNA path functions into own C++ fileJulian Eisel
NOTE: This is committed to the 3.3 branch as part of D15606, which we decided should go to this release still (by Bastien, Dalai and me). That is because these are important usability fixes/improvements to have for the LTS release. Adds `rna_path.cc` and `RNA_path.h`. `rna_access.c` is a quite big file, which makes it rather hard and inconvenient to navigate. RNA path functions form a nicely coherent unit that can stand well on it's own, so it makes sense to split them off to mitigate the problem. Moreover, I was looking into refactoring the quite convoluted/overloaded `rna_path_parse()`, and found that some C++ features may help greatly with that. So having that code compile in C++ would be helpful to attempt that. Differential Revision: https://developer.blender.org/D15540 Reviewed by: Brecht Van Lommel, Campbell Barton, Bastien Montagne
2022-08-04Fix the menu popup location when dropping blend files under WaylandCampbell Barton
Even though the event's location matched the drop event, the `wmWindow.eventstate` was not updated which was used for the pop-up menu location.
2022-07-30Sculpt: Opaque vertex type for sculptJoseph Eagar
This is a port of sculpt-dev's `SculptVertRef` refactor (note that `SculptVertRef was renamed to PBVHVertRef`) to master. `PBVHVertRef` is a structure that abstracts the concept of a vertex in the sculpt code; it's simply an `intptr_t` wrapped in a struct. For `PBVH_FACES` and `PBVH_GRIDS` this struct stores a vertex index, but for `BMesh` it stores a direct pointer to a BMVert. The intptr_t is wrapped in a struct to prevent the accidental usage of it as an index. There are many reasons to do this: * Right now `BMesh` verts are not logical sculpt verts; to use the sculpt API they must first be converted to indices. This requires a lot of indirect lookups into tables, leading to performance loss. It has also led to greater code complexity and duplication. * Having an abstract vertex type makes it feasible to have one unified temporary attribute API for all three PBVH modes, which in turn made it rather trivial to port sculpt brushes to DynTopo in sculpt-dev (e.g. the layer brush, draw sharp, the smooth brushes, the paint brushes, etc). This attribute API will be in a future patch. * We need to do this anyway for the eventual move to C++. Differential Revision: https://developer.blender.org/D14272 Reviewed By: Brecht Van Lommel Ref D14272
2022-07-29Cleanup: Replace reinterpret_cast<> with static_cast<> in UI codeJulian Eisel
2022-07-29Cleanup: Move RNA path functions into own C++ fileJulian Eisel
Adds `rna_path.cc` and `RNA_path.h`. `rna_access.c` is a quite big file, which makes it rather hard and inconvenient to navigate. RNA path functions form a nicely coherent unit that can stand well on it's own, so it makes sense to split them off to mitigate the problem. Moreover, I was looking into refactoring the quite convoluted/overloaded `rna_path_parse()`, and found that some C++ features may help greatly with that. So having that code compile in C++ would be helpful to attempt that. Differential Revision: https://developer.blender.org/D15540 Reviewed by: Brecht Van Lommel, Campbell Barton, Bastien Montagne
2022-07-28Curves: enable density brush when first entering curves sculpt modeJacques Lucke
Previously, no tool was selected, which was a bug.
2022-07-27ID namemap: Add check for consistency.Bastien Montagne
Add a util function to check that content of a given Main and the namemaps in it are consistent. Add some asserts calling this check after file read, and after some override operations.
2022-07-27Cleanup: Move wm_dragdrop.c to C++Hans Goudey
2022-07-26Cleanup: spelling in commentsCampbell Barton
2022-07-21Cleanup: add ISMOUSE_MOTION macroCampbell Barton
Replace verbose ELEM(..) usage, now each kind of mouse event has it's own macro.
2022-07-21Fix WM_event_type_mask_test ignoring wheel and gesture eventsCampbell Barton
WM_event_type_mask_test checks assumed ISMOUSE macro worked for any kind of mouse event when it only accepted buttons & motion. Now ISMOUSE checks for any kind of mouse event, use ISMOUSE_BUTTON/WHEEL/GESTURE for more specific checks.
2022-07-21WM: replace ISMOUSE with ISMOUSE_BUTTONCampbell Barton
The ISMOUSE macro was used in situations only button events needed to be checked. The only functional difference would be MOUSEMOVE events were previously accepted for these checks.
2022-07-21WM: categorize smart-zoom as a gestureCampbell Barton
Event handling and the enum definition documents MOUSESMARTZOOM as a gesture however it wasn't accepted by ISMOUSE_GESTURE, instead it was added to the ISMOUSE macro. Move the type check to ISMOUSE_GESTURE.
2022-07-19Fix T99737: Dropping files fails with WaylandCampbell Barton
Drop events ignored the cursor coordinates, under the assumption that cursor motion events would also be sent to update the cursor location. This depended on the behavior of the compositor, it failed for Sway but worked for Gnome-shell & River. Resolve by making use of the drop events cursor coordinates.
2022-07-15Fix Eevee backround render crash after recent changes from D15463Brecht Van Lommel
Backend initialization needs to be delayed until after the OpenGL context is created. This worked fine in foreground mode because the OpenGL context already exists for the window at the point GPU_backend_init_once was called, but not for background mode. Create the backend just in time in GPU_context_create as before, and automatically free it when the last context id discarded. But check if any GPU backend is supported before creating the OpenGL context. Ref D15463, D15465
2022-07-15Fix GPU backend deleting resources without an active contextBrecht Van Lommel
This causes an assert with libepoxy, but was wrong already regardless. Refactor logic to work as follows: * GPU_exit() deletes backend resources * Destroy UI GPU resources with the context active * Call GPU_backend_exit() after deleting the context Ref D15291 Differential Revision: https://developer.blender.org/D15465
2022-07-15Fix T99706: Crash rendering with headless buildsCampbell Barton
When rendering with headless builds, show an error instead of crashing. Previously GPU_backend_init was called indirectly from DRW_opengl_context_create, a new function is now called from the window manager (GPU_backend_init_once), so it's possible to check if the GPU has a back-end. This also disables the `bgl` Python module when building WITH_HEADLESS. Reviewed By: fclem Ref D15463
2022-07-15Fix an increasing bottleneck when key press operator is too slowSergey Sharybin
The goal of this change is to fix an increasing bottleneck of the event queue handling when there is an operator bound to a key press event and is taking longer to finish than a key-repeat speed on the system. Practical example of when it happens is the marker tracking operator in a single-frame track mode. Quite often artists will hold down Alt-arrow to track a segment of footage which seems trivial to track. The issue arises when the Alt-arrow is released: prior to this change it is was possible that more frames will be tracked. It also seems that redraws are less smooth. It is a bit hard to make easily shareable computer-independent test case. Instead, a synthetic case can be reproduced by adding a 50 ms sleep in the `text_move_exec()`. In such synthetic case open a long text in the text editor and hold left/right arrow button to navigate the cursor. The observed behavior is that seemingly redraws happen less and less often and cursor travels longer and longer distances between redraws. The cursor will also keep moving after the buttons has been released. The proposed solution is to ignore sequential key-press events from being added to the event queue. This seems to be the least intrusive and the most safe approach: - If the operator is fast enough there will be no multiple press events in the queue in both prior and after of this change. - If the operator is slow enough, clicking the button multiple times (i.e. clicking arrow button 3 times in a heavy shot will change the scene frame by exactly 3 frames because no events are ignored in this case). - Only do it for key press events, keeping mouse and tabled behavior unchanged which is crucial for the paint mode. Note that this is a bit different from the key repeat tracking and filtering which is already implemented for keymaps as here we only want to avoid the event queue build-up and do want to ignore all repeat events. In other words: we do want to handle as many key presses as the operator performance allows it without clogging anything. A possible extension to this change could be a key press counter, so that instead of ignoring the event we merge it into the last event in the queue, incrementing some counter. This way if some operator really needs to know exact number of key repeats it can still access it. Differential Revision: https://developer.blender.org/D15444
2022-07-14Fix `on_drag_start` handler not getting ID when dragging from OutlinerJulian Eisel
We would first invoke the dragging, and then set the drag data (like the ID or the dragged modifier), so the `wmDropBox.on_drag_start()` handler wouldn't be able to access this. This broke dragging some IDs from the Outliner, noticed in D15333. It's now possible to first create/request drag data, extend it, and then invoke the actual dragging. The normal function to start dragging returns `void` now instead of `wmDrag *`, so the drag data can't easily be modified after starting anymore.
2022-07-14Cleanup: update & correct comments for event handlingCampbell Barton
- Remove references to `ISTEXTINPUT` as any keyboard event with it's utf8_buf set can be handled as text input. - Update references to the key repeat flag.
2022-07-14WM: Remove ASCII members from wmEvent & GHOST_TEventKeyDataCampbell Barton
The `ascii` member was only kept for historic reason as some platforms didn't support utf8 when it was first introduced. Remove the `ascii` struct members since many checks used this as a fall-back for utf8_buf not being set which isn't needed. There are a few cases where it's convenient to access the ASCII value of an event (or nil) so a function has been added to do that. *Details* - WM_event_utf8_to_ascii() has been added for the few cases an events ASCII value needs to be accessed, this just avoids having to do multi-byte character checks in-line. - RNA Event.ascii remains, using utf8_buf[0] for single byte characters. - GHOST_TEventKeyData.ascii has been removed. - To avoid regressions non-ASCII Latin1 characters from GHOST are converted into multi-byte UTF8, when building X11 without XInput & X_HAVE_UTF8_STRING it seems like could still occur.
2022-07-11Fix (studio-reported) crash in ID remapping code on rare cases.Bastien Montagne
Some ID types did not have a filter value, even though they would be used in remapping code, leading to missing remappings. In that specific case, shape keys would actually never be properly remapped. Reproducible in r1230 of `Heist/pro/animation_test/einar/einar_new_expression_shapes2.blend`,
2022-07-07UI: Superimposed pin icon for workspace scene pinning in the scene switcherJulian Eisel
Followup to the previous commit, to display a pin icon in the scene switcher. This is a good indicator to have and such workspace-wide functionality should be available in the topbar, close to what it belongs to (scene switching). Downside is that it makes this already crowded region even more crowded. But thanks to the use of superimposed icons, it's not too noisy visually. Differential Revision: https://developer.blender.org/D11890 Reviewed by: Campbell Barton
2022-07-07Workspaces: Option to pin scene to a workspaceJulian Eisel
Adds a "Pin Scene" option to the workspace. When activated, the workspace will remember the scene that was last activated in it, so that when switching back to this workspace, the same scene will be reactivated. This is important for a VSE workflow, so that users can switch between different workspaces displaying a scene and thus a timeline for a specific task. The option can be found in the Properties, Workspace tab. D11890 additionally adds an icon for this to the scene switcher in the topbar. The workspace data contains a pointer to the scene which is a UI to scene data relation. When appending a workspace, the pointer is cleared. Differential Revision: https://developer.blender.org/D9140 Reviewed by: Brecht Van Lommel, Bastien Montagne (no final accept, but was fine with the general design earlier)
2022-07-06Cleanup: spelling in commentsCampbell Barton
2022-07-04Fix use-after-free error when handling events that close windowsCampbell Barton
Regression in [0] caused operations such as file-load or file-new from any window besides the first to write into the freed: `wmWindow.eventstate`. Resolve by copying the event instead of restoring the region relative cursor position after modifying it. [0]: 789b1617f70e07f1c9bcb5253f1233acacbf6c8a
2022-07-04Cleanup: remove unused WM_event_is_last_mousemoveCampbell Barton
This was part of walk-mode logic that implemented it's own cursor-grab, now this has been moved to use GHOST's cursor grabbing, it's no longer needed.