Commit Graph

695 Commits

Author SHA1 Message Date
Campbell Barton
d98a7a7756 Merge branch 'blender-v4.2-release' 2024-06-06 10:23:16 +10:00
Campbell Barton
7f7648c6ed Cleanup: spelling in code comments & minor edits
- Use uppercase NOTE: tags.
- Correct bNote -> bNode.
- Use colon after parameters.
- Use doxy-style doc-strings.
2024-06-06 09:55:13 +10:00
Richard Antalik
aa39d5ca83 VSE: Copy strip opacity when adding effect
Blend mode was already copied from effect strip input. It is reasonable
to copy opeacity as well.
2024-06-06 01:07:28 +02:00
Sebastian Parborg
38dd4a5e9a Fix: Wonky behaviour of "Frame All" and "Frame Selected" in the VSE
Both these operators would quite often put the framed strips offscreen.
This was in part due to the padding need to make sure that the strips
were not going to be obscured by the scrub area or overlays not being
applied or calculated correctly.

In addition to that, the view positioning logic was not in sync with the
vertical clamping code. This lead to the operators positioning the view
into a forbidden state. So the clamping logic would adjust the view
afterwards and thus put some of the framed strips offscreen.

This patch unifies the logic used by the "frame X" operators and the
clamping code, making them play nice with each other.

Pull Request: https://projects.blender.org/blender/blender/pulls/122219
2024-06-05 11:18:23 +02:00
Campbell Barton
57707ca9ae Cleanup: const pointers for FCurves where possible 2024-05-21 13:17:35 +10:00
Campbell Barton
096eed9d7f Cleanup: spelling in comments 2024-05-20 10:23:54 +10:00
Aras Pranckevicius
e7801e0d07 Fix #121935: VSE text outline artifacts while tweaking parameters
Code was wrongly using non-initialized arrays of JFA intermediate
steps. Make sure to initialize them to invalid JFA coordinate.
2024-05-18 18:00:58 +03:00
Richard Antalik
22ca19dcb2 Cleanup: Add enum for referring to VSE strip handles.
This is used instead of unnamed enum `SEQ_SIDE_*`, which is used in
various operations and refers to direction in general.

Pull Request: https://projects.blender.org/blender/blender/pulls/121808
2024-05-15 01:48:18 +02:00
Richard Antalik
d1bad9ddfe Fix #120709: VSE retiming depends on Strip start frame
Caused by using timeline frame instead of frame index as argument for
`seq_retiming_evaluate()` in `claculate_speed_table_from_seq()`.
This bug only affected speed transitions in sound strips.

`RetimingRangeData` also incorrectly interpreted segment type after
transition end, which would not cause issues, but was incorrect.
2024-05-10 20:20:06 +02:00
Aras Pranckevicius
008483fe8a Cleanup: Remove non-working channels parameter of BLF_buffer
BLF_buffer was trying to accept "how many colors channels in output
image?" argument and doing math with it, but in the lowest level code
was always writing out full 4 channels for each pixel.

All the call sites would ever call it with argument of 4 however, and
that is why no one noticed the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/121630
2024-05-10 18:54:53 +02:00
Aras Pranckevicius
52de90d06b Cleanup: redundant namespace, naming, span instead of array ref 2024-05-10 19:07:53 +03:00
Aras Pranckevicius
a17ce1a1b4 VSE: Optimize text shadow blur / outline options
PR #121478 added options for blurred shadows and text outline for text strips.
However since text strips produce an image that is size of the "whole screen",
applying large blurs or wide outline on that is quite costly.

Make both blur and outline calculations only be performed on the text bounds
(offset and expanded as needed to take into account blur/outline width).

On Windows/VS2022/Ryzen5950X machine, with 4K VSE resolution, and text strip
that takes about 900x400 pixels on screen, applying blur 0.4 and outline 0.25,
time to render the text strip goes from 470ms down to 35ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/121644
2024-05-10 17:57:20 +02:00
Aras Pranckevicius
d66598c16f VSE: Text shadow blur / outline
Text strips in VSE got:
- Configurable shadow angle and offset (previously shadow location relative to
  text was fixed). Currently the shadow position is rounded to integer pixel
  locations; sub-pixel positioning might come later.
- Optional shadow blur amount.
- Optional outline, with color and outline width controls. Outline is
  implemented using jump flooding algorithm.

Images and more detail in pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/121478
2024-05-08 11:13:20 +02:00
Richard Antalik
897664ccc5 Fix #121319: Mask modifier not clamped to mask strip
Skip modifier, when using strip as a mask that ends before specified
timeline frame. To make behavior of missing mask more consistent,
modifier is also skipped, when strip produces blank output due to
missing data.

Skipping modifier due strip boundary only works, when "Mask Time" is set
to Relative mode. This is because absolute mode ignores strip offsets.

Pull Request: https://projects.blender.org/blender/blender/pulls/121498
2024-05-07 19:37:24 +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
69472c88ee IMB: Cleanup timecode options
Remove options that are duplicate and change description of options, so
they describe bit better, how timecodes are actually used.

Timecodes in Blender have pretty much nothing in common with more widely
known term "timecode". This confused users (and developers).
There were 5 options of which 3 were exactly same. This commit leaves
user with 3 options:
 - Use timecodes for normal seeking/playback - Record Run
 - Ensure, that no frame is duplicated or skipped - "Record Run No Gaps"
 - Do not use timecodes - "None"

More verbose description was added to the definition in code.

Naming of these timecode types was kept, even if it is incorrect to not
break scripts and habits.

Pull Request: https://projects.blender.org/blender/blender/pulls/121001
2024-05-06 17:56:56 +02:00
Campbell Barton
9918488bb1 Cleanup: use uppercase tags, following own style guide 2024-05-03 11:33:21 +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
Aras Pranckevicius
0a911b42c6 Fix #121190: VSE AlphaUnder with opacity=1 does not work properly
Accidental logic change in PR #116089, restore previous behavior

Pull Request: https://projects.blender.org/blender/blender/pulls/121224
2024-04-30 08:32:25 +02:00
Campbell Barton
9558aafafb Sequencer: correct speed assignment
The argument was shadowing the class member.

Ref !121016
2024-04-25 12:02:11 +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
Brecht Van Lommel
15b9ae5436 Refactor: Use typed functions for blend file data reading
This makes the read and write API functions match more closely, and adds
asserts to check that the data size is as expected.

There are still a few places remaining that use BLO_read_data_address
and similar generic functions, these should eventually be replaced as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/120994
2024-04-24 17:01:22 +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
John Swenson
cff532e134 VSE: Implement Snapping to Markers
This patch adds the ability to snap strips to markers. Previously, there
only existed options to snap to hold offsets and the current frame.

This snap type works identically to other snapping options by checking
for the relevant bit (here `SEQ_SNAP_TO_MARKERS`) and adding the marker
frame numbers to `snap_data->target_snap_points` within
`seq_snap_target_points_build()`.

To enable `seq_get_snap_target_points_count()` to have access to marker
information, the current Scene object is now passed to the function.

Pull Request: https://projects.blender.org/blender/blender/pulls/120450
2024-04-23 01:54:14 +02:00
Aras Pranckevicius
91f0368fe2 Fix #120871: VSE crashes when sound strip has hold start offset larger than start
Caused by addition of new code in 4e10aa6e71, which was not guarding
against negative frame values. The only other place that called
BKE_sound_set_scene_sound_pitch_constant_range guarded against negative
frames (added in 1fb692e896 + 49a0502f35), but generally it looks like
negative frames are a "no no" in audaspace, so just move the value
sanitization into BKE_sound_set_scene_sound_pitch_constant_range itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/120891
2024-04-22 14:44:05 +02:00
Campbell Barton
fd589fdca4 Cleanup: various non functional C++ changes 2024-04-20 13:46:14 +10:00
Campbell Barton
4e8b24f1d1 Cleanup: spelling in comments & punctuation 2024-04-19 15:57:06 +10:00
Campbell Barton
7e5a6d8dd5 Cleanup: correct argument order & naming
Correct swapped arguments, no functional changes.
2024-04-11 20:19:01 +10:00
Campbell Barton
09ee8d97e6 Cleanup: use C-style comments for descriptive text 2024-04-11 17:44:27 +10:00
Philipp Oeser
1fdd7cd098 Fix #120417: VSE crash rendering a scene strip with missing Editing data
In case a scene strips `Input` was set to `Sequencer`, but the scene did
not actually have `Editing` data (e.g. when just adding a `New` scene as
scene strip), blender would crash trying to render.

Now simply check if the required `Editing` data is present before
proceeding.

Pull Request: https://projects.blender.org/blender/blender/pulls/120418
2024-04-10 14:21:21 +02:00
Campbell Barton
6776d68f5e Cleanup: avoid shadowing variables 2024-04-09 14:07:17 +10:00
Campbell Barton
52ce8d408f Cleanup: use const arguments & variables 2024-04-04 10:55:10 +11:00
Campbell Barton
b03332a055 Cleanup: use BLI_assert_msg instead of checking string literals 2024-04-03 14:27:54 +11:00
Campbell Barton
d5d1025e94 Cleanup: use const pointer arguments 2024-04-03 10:22:05 +11:00
Campbell Barton
7ce68904eb Cleanup: replace suspicious use of "&" with "&&" 2024-04-01 22:20:09 +11:00
Campbell Barton
7e5a712e58 Cleanup: remove redundant null pointer checks
Based on the surrounding context these checks aren't needed.
2024-04-01 22:20:09 +11:00
Campbell Barton
04b6fe78e7 Fix integer truncation when calculating int64_t values
Large int64_t values were calculated and assigned int however the
calculation was performed on integer types which would truncate the
result before casting to an in64_t.
2024-04-01 22:19:36 +11:00
Campbell Barton
b2e00d1285 Cleanup: use const pointer arguments 2024-03-28 20:57:50 +11:00
Campbell Barton
5685481fcb Cleanup: rename "name" to "filepath" for full paths 2024-03-28 20:57:50 +11:00
Campbell Barton
0ef033750f Cleanup: pass arguments by const reference 2024-03-28 17:16:33 +11:00
Harley Acheson
27c95da888 Refactor: Remove BLF _ex functions using default arguments
Remove all BLF "_ex" versions of functions by using default arguments.
These functions only differ by having an optional argument that can
return extra details about the result of the operation. This PR just
make these part of the main function as optional arguments with default
values - all nullptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/119994
2024-03-28 04:02:13 +01:00
Campbell Barton
0d3ea69daa Fix sizeof(sizeof(...)) passed to BLI_path_slash_ensure
Regression in [0] which would cause ensuring the slash to do nothing
in most cases. Note that the slash may not be needed, but that should
be handled separately.

[0]: d66f24cfe3
2024-03-28 11:40:21 +11:00
Hans Goudey
efee753e8f Cleanup: Move BKE_idprop.h to C++ 2024-03-26 13:07:04 -04: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
JonasDichelle
8812be59a4 Compositor: Make Hue Correct node wrap
Compositor: Make Hue Correct node wrap

This patch makes the Hue Correct node as well as the Hue Correct VSE
modifiers to wrap, such that no discontinuities occur for the red hue.
Since it now wraps, the default curve preset now exempts the last point
of the curve.

A new CUMA_USE_WRAPPING flag was added to specify wrapping for curve
maps. The implementation works by adding two virtual points before and
after the terminal points in the curve map, such that their handles
match, and would then produce a continues curve.

This is a breaking change, since existing curves were also adjusted
using versioning. However, the change will not be significant, since in
most realistic cases, the terminal points will be close to each other,
and even with wrapping, the connection will be very sharp, almost
matching the old behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/117114
2024-03-21 15:35:02 +01:00
Omar Emara
2906ea9785 BLI: Add nearest interpolation with clamped boundary
This patch adds clamped boundaries variants of the nearest interpolation
functions in the BLI module. The naming convention used by the bilinear
functions were followed.

Needed by #119414.

Pull Request: https://projects.blender.org/blender/blender/pulls/119732
2024-03-21 13:22:10 +01:00
Campbell Barton
fbe16bc1eb BLI_delete: assert that dir is true when recursive is true
While this isn't an error avoid ambiguity for recursive deletion
as it's not meaningful to delete a file.
2024-03-21 09:43:40 +11:00
Aras Pranckevicius
6826efdb02 Fix #119456, #119493: VSE adjustment/text strips do not update in some cases
As part of PR #118396 the "generator" effect strips (color, text,
adjustment) also started to put their "raw" images into the cache.
However, seq_cache_timeline_frame_to_frame_index that has optimization
that tries to use only one cache entry based on how many frames are
present in the strip was not expecting to see effect strips, ever.

As a result, something like adjustment layer would effectively just
cache a single frame, since it has no "source frames" to speak of.

Fixed that by only doing this optimization for non-effect strips.
2024-03-15 10:37:30 +02: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
fc32b9c5dd Fix: Crash when multiview movie right view is missing.
Ultimately this was due to missing nullptr check before trying to
process the image, but this should have been caught when loading
ImBufAnims. If any is missing, cancel multiview loading and load
movie as if it was single view only.
2024-03-02 18:12:47 +01:00