Commit Graph

681 Commits

Author SHA1 Message Date
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
Bastien Montagne
de5451b112 Cleanup: Move BKE_anim_data header to be fully C++. 2024-02-28 11:51:03 +01:00
Hans Goudey
d338261c55 Cleanup: Pass Span by value
Also pass Span instead of `const Array &`
and use parantheses for BLI includes.
2024-02-27 23:09:54 -05:00
Richard Antalik
d4925b9775 Cleanup: Refactor VSE movie loading
Original code was very confusing, with seemingly indecisive logic.
I hope, that it is less confusing now, however there is still some
indecisiveness present. This is because multiview configuration may not
be correct, so there must be fallback and only some multiview settings
require loading of multiple files. Perhaps be better wording could be
used for `open_anim_file_multiview()`.
Fortunately this is now expressed within 5 lines of code instead of 100.

Further this can be improved by checking if the file exists, since now
VSE crashes when right eye image is missing, because loading code
does not try to actually open the file.

Pull Request: https://projects.blender.org/blender/blender/pulls/118580
2024-02-22 17:48:40 +01:00
Aras Pranckevicius
f4f708a54f VSE: Skip rendering lower strips that are behind opaque strips above them
Often in previs setups, you have several "variations" of image/movie strips
for review, where the topmost one completely covers the others under it. VSE
rendering already had an optimization where if there's a fully opaque strip
that covers the whole screen, then the lower strips are skipped from
processing/rendering. However, it was not handling the case of non-fullscreen
strips (e.g. you'd have a Color strip near top & bottom for letterboxing, and
an opaque strip "in the middle").

This adds a simple "occluder tracking", and skips strips that are completely
covered by any single opaque strip that is above it (like outlined in #117790
task).

Playback of Gold previs between 1:42 and 1:55, on Windows/Ryzen5950X:
- Average frame time 28.5ms -> 23.8ms
- Median frame time 24.1ms -> 21.5ms
- Two slowest frames: 263->189ms, 194->178ms

Rendering the Gold previs movie: 325s -> 304s (93% of previous time)

Pull Request: https://projects.blender.org/blender/blender/pulls/118396
2024-02-21 20:16:44 +01:00
Hans Goudey
81a63153d0 Despgraph: Rename "copy-on-write" to "copy-on-evaluation"
The depsgraph CoW mechanism is a bit of a misnomer. It creates an
evaluated copy for data-blocks regardless of whether the copy will
actually be written to. The point is to have physical separation between
original and evaluated data. This is in contrast to the commonly used
performance improvement of keeping a user count and copying data
implicitly when it needs to be changed. In Blender code we call this
"implicit sharing" instead. Importantly, the dependency graph has no
idea about the _actual_ CoW behavior in Blender.

Renaming this functionality in the despgraph removes some of the
confusion that comes up when talking about this, and will hopefully
make the depsgraph less confusing to understand initially too. Wording
like "the evaluated copy" (as opposed to the original data-block) has
also become common anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/118338
2024-02-19 15:54:08 +01:00
Aras Pranckevicius
69b9735ce2 Merge branch 'blender-v4.1-release' 2024-02-16 20:56:56 +02:00
Aras Pranckevicius
6508ed8a3f Fix #118213: Applying effects to VSE Color/Text strips makes both the effect and source strip visible
This is different from applying effects to regular "source media" strips
like images or movies; an effect "hides" the input strip when it is
below itself in the channel.

Apply the same treatment to Color & Text strips. Fixes #118213.

If someone wants previous behavior for some reason, they can drag
the effect applied on Color/Text to be below the input strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/118269
2024-02-16 20:56:06 +02:00
Aras Pranckevicius
b4c6c69632 ImBuf: do not clear newly allocated image pixels when not needed
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
2024-02-15 14:54:57 +01:00
Campbell Barton
fee47f6da8 Cleanup: unused includes in source/blender/sequencer
Remove 95 includes.
2024-02-13 13:37:56 +11:00
ok_what
751d9c5999 Fix: VSE transition strip factor is not clamped
Previewing strip outside of it's boundary caused overflow.
Clamp the factor to prevent overflow.

Pull Request: https://projects.blender.org/blender/blender/pulls/118086
2024-02-12 21:21:19 +01:00
Bastien Montagne
5aaadebbe4 Cleanup: Make BKE_scene.h a full Cpp header. 2024-02-10 19:16:25 +01:00
Bastien Montagne
29fe777445 Cleanup: Make BKE_report.h a full Cpp header. 2024-02-10 18:34:29 +01:00
Bastien Montagne
54618dbae3 Cleanup: Make BKE_global.h a Cpp header. 2024-02-10 18:25:14 +01:00
Bastien Montagne
45e7827898 Clenup: Move BLT headers to Cpp.
Noisy but fairly straight forward.
2024-02-09 18:59:42 +01:00