Commit Graph

1967 Commits

Author SHA1 Message Date
Aras Pranckevicius
3582e52f9c UI: Improved overlay text contrast with new outline text decoration
Overlay texts were previously drawn with two sets of shadows:
- 3px blur,
- 5px blur, slightly offset

But since the shadow color was always set to black, it was still
causing legibility issues when the text itself was dark (set
via theme for example).

This PR adds a new "outline" BLF text decoration, and uses that
for the overlays. And it picks text/outline color depending
on the "background" color of the view.

Details:

- Instead of "shadow level" integer where the only valid options
  are 0, 3 or 5, have a FontShadowType enum.
- Add a new FontShadowType::Outline enum entry, that does a 1px
  outline by doing a 3x3 dilation in the font shader.
- BLF_draw_default_shadowed is changed to do outline, instead of
  drawing the shadow twice.
- In the font shader, instead of encoding shadow type in signs of
  the glyph_size, pass that as a "flags" vertex attribute. Put
  font texture channel count into the same flags, so that the
  vertex size stays the same.
- Well actually, vertex size becomes smaller by 4 bytes, since turns
  out glyph_mode vertex attribute was not used for anything at all.

Images in the PR.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121383
2024-05-10 21:06:44 +02:00
Richard Antalik
afa828ffca VSE: Various refactorings
These changes are not very useful on their own, but committed in order
to make PR #109522 easier to review
2024-05-07 13:37:16 +02:00
Richard Antalik
b062980318 Cleanup: Refactor VSE handle drawing code
Split handle rectangle and handle position text drawing to separate
functions.
2024-05-07 13:37:16 +02:00
Guillermo Venegas
89c1f7e0c3 IO: Use file handler in space VSE
Uses `FileHandlers` to handle file drag-n-drop in the space Sequencer, drop-boxes
still remain since they handle Images ID drag-n-drop.

This also allows to open/drag-n-drop multiple files at once.

When drag-and-drop is performed with a single image/movie/sound
file and only the internal `FileHandler` can be used, is used
the internal drop-box api for drag and drop, since it has a nice
drag-and-drop preview.

Pull Request: https://projects.blender.org/blender/blender/pulls/119927
2024-05-06 17:44:50 +02:00
Campbell Barton
4f5f0040c0 Cleanup: back-tick quote file extensions in code-comments 2024-05-04 15:06:46 +10:00
Sebastian Parborg
221951657b VSE: Make cache overlay visible to non "Developer extras" users
This also moves the option to be a per editor space setting so you can
have different cache visualization options in different editor spaces
at the same time.

A quick toggle for the cache visualization is now available in the
overlays popover.

Pull Request: https://projects.blender.org/blender/blender/pulls/119428
2024-05-02 16:36:11 +02:00
Harley Acheson
529b8786f8 UI: Custom Text and Confirmation Button Text for Props Confirm
For operators that use WM_operator_props_popup_confirm allow custom
title and confirmation button text.

Pull Request: https://projects.blender.org/blender/blender/pulls/121287
2024-05-01 16:29:19 +02:00
Aras Pranckevicius
3847cf4dc1 VSE: Revert strip text color to white
PR #118581 changed strip text color to be the same as active strip
theme outline, which been widely regarded as a bad move. Revert
text color to white just like it was before.
2024-04-29 20:45:34 +03:00
Richard Antalik
fd96b81821 Fix #120834: Retiming does not work as expected.
This happened, because of lazy initialization of clicked retiming keys.
When the key is moved, the speed changed in respect to strip start, not
(uninitialized, but drawn) key at left handle.

Initialize both keys when any virtual key is selected.
2024-04-28 03:41:52 +02:00
Pratik Borhade
1f10100f46 Fix: memory leak in sequencer_preview_add_sound
Move memory allocation of `audiojob` after if/else condition. Otherwise
there is possible chance of memory leak due early exit from that
function.

Part of #120767

Pull Request: https://projects.blender.org/blender/blender/pulls/121006
2024-04-25 13:24:49 +02:00
Campbell Barton
bc7e7b80fc Cleanup: use const arguments & remove redundant check 2024-04-25 12:02:15 +10:00
Aras Pranckevicius
31e56797f0 VSE: indicate missing media in timeline/display
Sequencer timeline displays red tint & appropriate icons for strips that are
missing media file (images, movies, audio, or meta strips that contain such).

Sequencer preview and rendering displays missing media strips as magenta,
similar to missing textures elsewhere in Blender. This is on by default,
sequencer view settings have an option to turn it off.

Pull Request: https://projects.blender.org/blender/blender/pulls/116869
2024-04-24 19:54:44 +02:00
Pablo Vazquez
3ac504b8f6 VSE: Draw outline on active unselected strips
In Blender 4.1 and prior, you can tell apart the active-unselected strip
because it would have no thick outline but the text would be highlighted.

However, if label overlays were disabled there would be no way to know tell
them apart. Solve this by drawing a subtle 1px outline on active unselected
strips, using the active outline color but slightly dimmed.

Pull Request: https://projects.blender.org/blender/blender/pulls/121029
2024-04-24 19:24:11 +02:00
Aras Pranckevicius
c64050ecd2 VSE: Timeline strip visual design updates
Design updates as per #118288:
- Tweak text labels (colors, drop shadows)
- Strip border colors, inset outlines
- Muted strips are mostly gray, and their thumbnails are faded
- Overlapping strips are not semitransparent anymore
- Locked stripes only in content area
- Missing data blocks
- Updates to meta strips w/ missing data blocks

Pull Request: https://projects.blender.org/blender/blender/pulls/118581
2024-04-24 12:37:38 +02:00
Campbell Barton
7f2c0311fc Cleanup: fully initialize timeline_draw_context_get's return value
timeline_draw_context_get relied on the caller assigning "quads",
since setting the value is required, pass in "quads" as an argument.
2024-04-24 16:33:54 +10:00
Campbell Barton
e082049dff Cleanup: use early return, avoids passing uninitialized argument
An uninitialized `msg` string could be passed into ED_area_status_text
however the argument wasn't used when the area was null.

Even though this isn't a bug it relies on the `area` check in the
implementation to ignore the uninitialized argument.

Simplify logic by returning early when area is null.
2024-04-23 15:44:16 +10:00
Campbell Barton
fd589fdca4 Cleanup: various non functional C++ changes 2024-04-20 13:46:14 +10:00
Boltzmachine
740c9f220d VSE: Add RGB Parade Display Mode for sequencer
This PR implements #120479 by adding a new Waveform Display Mode
"RGB Parade" that will essentially be the Luma Waveform but with
"Separate Colors" turned on.

Pull Request: https://projects.blender.org/blender/blender/pulls/120615
2024-04-18 21:25:44 +02:00
Campbell Barton
430d7961a2 Cleanup: remove redundant checks & struct declaration 2024-04-08 12:03:08 +10:00
Campbell Barton
bce2cf5f92 Cleanup: use const EnumPropertyItem pointers 2024-04-08 12:03:03 +10:00
Campbell Barton
52ce8d408f Cleanup: use const arguments & variables 2024-04-04 10:55:10 +11:00
Campbell Barton
d5d1025e94 Cleanup: use const pointer arguments 2024-04-03 10:22:05 +11:00
Campbell Barton
fa4fdbf356 Cleanup: remove repeated flags in bit-flag literals 2024-04-01 22:20:09 +11:00
Campbell Barton
686605a6dd Cleanup: declare arrays as const where possible 2024-03-28 22:57:57 +11:00
Campbell Barton
b2e00d1285 Cleanup: use const pointer arguments 2024-03-28 20:57:50 +11:00
Campbell Barton
b4517ca148 Cleanup: replace suspicious use of "&" with "&&"
"&" was used in some cases where "&&" is more typically used,
while "&" works when both values happen to be 1, this doesn't read well.
2024-03-28 17:26:16 +11:00
Campbell Barton
155dae94d7 Cleanup: code-comments, use doxygen formatting & spelling corrections
Also move some function doc-strings from the implementation
to their declarations.
2024-03-26 17:55:20 +11:00
Hans Goudey
893130e6fe Refactor: Remove unnecessary C wrapper for GPUBatch class
Similar to fe76d8c946

Pull Request: https://projects.blender.org/blender/blender/pulls/119898
2024-03-26 03:06:25 +01:00
Hans Goudey
fe76d8c946 Refactor: Remove unnecessary C wrappers for vertex and index buffers
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
2024-03-24 16:38:30 +01:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00
Richard Antalik
3f4d924298 Fix #118633: View limiting does not work if VSE is uninitialized
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
2024-03-22 20:10:53 +01:00
Aras Pranckevicius
ce5f864027 Merge branch 'blender-v4.1-release' 2024-03-15 16:55:41 +02:00
Aras Pranckevicius
52a8bea237 Fix #119505: artifacts in VSE vectorscope
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
2024-03-15 15:53:25 +01:00
Campbell Barton
cb4351665a Cleanup: format, trailing space 2024-03-08 11:31:01 +11:00
Hans Goudey
744f3b2823 Cleanup: Grammar in comments: Fix uses of "own"
"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.
2024-03-07 16:23:35 -05:00
Hans Goudey
8c16d06858 Cleanup: Use reinterpret_cast instead of C-style cast 2024-03-07 09:30:22 -05:00
Falk David
a11335d19a Cleanup: Move BKE_fcurve.h to C++
No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119094
2024-03-05 18:39:08 +01:00
Richard Antalik
c2d8d84cd8 Merge branch 'blender-v4.1-release' 2024-03-02 18:34:38 +01:00
Richard Antalik
58a9acb016 Fix #118486: Prevent emitting error when adding VSE strips
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
2024-03-02 18:34:00 +01:00
Hans Goudey
d29ce3d531 UI: Remove uiBut a1 and a2 values
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.
2024-03-01 14:27:57 -05:00
Aras Pranckevicius
43d93973c0 Fix #118666: VSE scopes showing garbage data in some cases
Waveform/vecscope does not write all the image pixels, so they
have to be initialized upon imbuf creation.
2024-03-01 09:26:55 +02:00
Sebastian Parborg
dc2577d383 Merge branch 'blender-v4.1-release' 2024-02-29 13:12:03 +01:00
Sebastian Parborg
f8741580a6 Fix: Dropping sound/image/movieclip IDs into the VSE would not work as expected
The drop location would not be set correctly as we returned early if and
ID was dropped.
2024-02-29 13:08:51 +01:00
Harley Acheson
da378e4d30 UI: Changes to Props Dialogs
Improved titles and confirm button text for 15 props dialogs.

Pull Request: https://projects.blender.org/blender/blender/pulls/118640
2024-02-27 20:19:33 +01:00
Sebastian Parborg
86c8c27974 Merge branch 'blender-v4.1-release' 2024-02-23 15:35:31 +01:00
ok_what
8b5f11839e Fix: Copying strip inside meta, copies top-most meta instead
When inside a meta strip, copying and pasting a strip would copy the
top-most meta strip, rather than the intended strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/118090
2024-02-23 15:08:14 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
2024-02-19 15:59:59 +01:00
Harley Acheson
4910de5160 Merge branch 'blender-v4.1-release' 2024-02-16 09:21:53 -08:00
Richard Antalik
a2c839e71c Fix #118190: Tool shortcut does not show in tooltip
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
2024-02-16 18:05:23 +01:00
Bastien Montagne
0801fcd6b3 Cleanup: make format 2024-02-15 19:49:58 +01:00