Age | Commit message (Collapse) | Author |
|
|
|
|
|
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
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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).
|
|
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.
|
|
|
|
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
|
|
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
|
|
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D15680
|
|
|
|
|
|
|
|
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.
|
|
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
|
|
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
|
|
|
|
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
|
|
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.
|
|
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
|
|
|
|
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
|
|
Previously, no tool was selected, which was a bug.
|
|
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.
|
|
|
|
|
|
Replace verbose ELEM(..) usage, now each kind of mouse event has it's
own macro.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
- 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.
|
|
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.
|
|
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`,
|
|
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
|
|
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)
|
|
|
|
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
|
|
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.
|