Now that all relevant code is C++, the indirection from the C struct
`GPUVertBuf` to the C++ `blender::gpu::VertBuf` class just adds
complexity and necessitates a wrapper API, making more cleanups like
use of RAII or other C++ types more difficult.
This commit replaces the C wrapper structs with direct use of the
vertex and index buffer base classes. In C++ we can choose which parts
of a class are private, so we don't risk exposing too many
implementation details here.
Pull Request: https://projects.blender.org/blender/blender/pulls/119825
This happened, because function returned early if `Editing` was nullptr.
However it is needed only for timeline boundbox, which is already initialized
for case where there are no strips.
Pull Request: https://projects.blender.org/blender/blender/pulls/118864
On some GPUs/drivers (seemingly nvidia) and screen sizes, VSE
vectorscope and sometimes waveform have "garbage" artifacts around
them.
Root cause unknown (driver bug?), for now similar fix as a while ago
in #112665: explicitly draw opaque background (with alpha=1), and then
use alpha blending for the scopes texture display on top of that.
Pull Request: https://projects.blender.org/blender/blender/pulls/119512
"Own" (the adjective) cannot be used on its own. It should be combined
with something like "its own", "our own", "her own", or "the object's own".
It also isn't used separately to mean something like "separate".
Also, "its own" is correct instead of "it's own" which is a misues of the verb.
When adding strips that generate image on their own, while 3 or more
strips are selected, it emits error. This was caused by incorrect
handling of this case in `seq_effect_find_selected()`. If effect has no
inputs, function should return early.
Pull Request: https://projects.blender.org/blender/blender/pulls/118866
Over the last couple years (!) UI buttons have moved to derived classes,
meaning we don't need to use the same "a1" and "a2" variables to store
different information. At this point, that information is set specifically
by internal UI code, or functions like `UI_but_*_set`.
These values are only set to their default 0 values now (or -1 in some
non-meaningful cases). This commit removes the values from buttons
and removes the remaining a1 and a2 arguments from the UI API.
fa6384eb39 introduced explicit setting of operator context as argument for
function `ED_region_panels_ex()`. However, this did not work correctly, because
`UiLayout` did not exist when `uiLayoutSetOperatorContext()` was called. This
has to be done in `ed_panel_draw()`.
Another issue is, that panel may be drawn, when mouse is over tool region,
which means, that `sequencer_tools_region_draw()` must look for whether
this is happening in preview or timeline region.
Pull Request: https://projects.blender.org/blender/blender/pulls/118292
In some/many cases, an `ImBuf` is allocated, and all the pixels are
immediately filled by some code. Doing the memory clear within allocation
is just memory traffic for no good reason.
Add a flag to skip initialization of ImBuf pixels (IB_uninitialized_pixels)
and use that in some parts of VSE effects/rendering/cache/scopes, as well
as image loading code.
Rendering out VSE movie, on Windows/VS2022/Ryzen5950X:
- Sprite Fright: 443sec -> 414sec (takes 93% of previous time)
- Gold previs: 367sec -> 325sec (takes 88% of prev time)
Pull Request: https://projects.blender.org/blender/blender/pulls/118321
The ID remapper code was already largely defined in a CPP struct
(IDRemapper). Make this an actual class, and remove the C API wrapper
around.
This makes the code cleaner, easier to follow, and easier to extend or
modify in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/118146
5 years ago (18b693bdbd) part of cache rendering was converted to not
draw one quad at a time. However the other part (drawing strip
backgrounds when cache visualization is on) was left still drawing one
quad at a time.
Now that sequencer timeline drawing code has SeqQuadsBatch that batches
arbitrary number of things for drawing fairly easily, the existing
cache drawing batching code can be simplified to just use that, and
the background code changed from immediate quad drawing to use the
batcher.
Sprite Fright edit, whole timeline visible, all caches visualized and
full: `draw_cache_view` on Windows/Ryzen5950X goes 2.40ms -> 0.16ms.
And there's less code.
Pull Request: https://projects.blender.org/blender/blender/pulls/118027
I added a new BLO_userdef_default.h header to contain declarations of
two global variables that are still defined in C files. Use of designated
initializers for large structs make those files harder to change.
Arguably this is a better header for them anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/118015
Remove ugly/fragile special case in `view2d_masks()` that would clamp
the scrollbar-masks by the scrubbing UI. It's now possible to pass
custom scrollbar-masks to `View2D` via `UI_view2d_scrollers_draw()`. So
use this instead, making region code control its own masks, rather than
relying on special case handling in generic `View2D` code.
Also update comment in `scroller_activate_init()` to make the implicit
relationship explicit.
Alternative to, and based on the investigation in !117685.
Pull Request: https://projects.blender.org/blender/blender/pulls/117984
Although the information displayed in the status bar is strictly
speaking reports, it makes sense to translate them using the Interface
setting instead of Reports, as the tool names and stats terms are
also translated in other UI places (toolbar, menus).
This change includes status bars statistics and keymaps, and viewport
statistics.
The change is quite extensive as it is all or nothing. Translating
keymaps using Interface means some status messages will include them
indirectly, and thus cannot use Reports without having a weird mix of
original and translated words. In turn, having only some messages
translated would be even more confusing.
The result is that all messages related to input are now translated with
Interface, which I think also makes sense.
Discussed as a followup to !116804.
-----
cc. @gtitaev
Pull Request: https://projects.blender.org/blender/blender/pulls/117234