Commit Graph

1331 Commits

Author SHA1 Message Date
Hans Goudey 09c7c63890 UI Code Quality: Use "params" struct for area and region callbacks
These functions with many arguments can be unwieldy. Aside from the obvious issues
with rewriting the list of arguments and the opportunities for error and frustration
that presents, the long list of arguments make these systems hard to change. So when
an argument should be added, someone might skip that and add some hack instead.

So, as proposed in T73586#1037210, this patch instead uses a "params" struct for
each of these callbacks.

- Use param argument for `ARegionType.listener`
    - Remove unused window field in region listener
- Use param argument for `SpaceType.listener`
- Use params struct for `ARegionType.message_subscribe`

Differential Revision: https://developer.blender.org/D9750
2021-01-18 17:28:47 -06:00
Campbell Barton 64929398fb Cleanup: skip accessing sequence strip name/source when hidden 2021-01-11 17:58:08 +11:00
Campbell Barton a83c67c183 Fix incorrect use of BLI_snprintf in sequencer text concatenation
The start of the text was stepped over without subtracting it's length
(introduced in fad80a95fd).

Replace this logic with BLI_string_join_array to simplify construction.
2021-01-11 17:51:42 +11:00
Campbell Barton b01e62e399 Fix missing directory separator in image/movie strip identifier 2021-01-11 17:17:10 +11:00
Campbell Barton 16aefea9fa Cleanup: use switch statement for sequence types
Also remove duplicate NULL pointer check and replace
BLI_snprintf with BLI_strncpy.
2021-01-11 17:13:27 +11:00
Peter Fog 544e371908 Fix T84529: Crash with strip using deleted scene
If scene strip has no scene assigned, leave source string empty.
Same goes for all other strips, that use ID datablocks.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D10058
2021-01-10 17:37:07 +01:00
Yevgeny Makarov 5424b4821d Fix T83094: Alternate rows in the Sequencer are green (macOS)
The issue is that `UI_GetThemeColorBlendShade4fv()` creates a color
with alpha, but there is not any background underneath to blend in with.

The solution is just to draw an opaque background first, which also
halves the number of rects to draw. Note that the brighter rows get
very slightly darker after this change.

Differential Revision: https://developer.blender.org/D9947
2021-01-05 14:21:54 -06:00
Campbell Barton 54f89e8704 Cleanup: docy comments beginning with '/**' don't end with '**/' 2021-01-04 17:38:11 +11:00
Richard Antalik 85951f8fde Cleanup: Move functions from sequencer_edit.c
These are utility functions that are not used in this file.

No functional changes.
2020-12-31 05:22:19 +01:00
Richard Antalik e5e57fe0a2 Cleanup: Remove unused functions from sequencer_edit.c
No functional changes.
2020-12-31 05:02:10 +01:00
Yevgeny Makarov 2d86175bac Fix unreported: Sequencer grid lines are not drawn
By design, there should be lines between the alternating horizontal
stripes in the Sequencer. But currently they are all drawn in one place,
on top of each other. Mistake in rBfae895125efe.

Differential Revision: https://developer.blender.org/D9962
2020-12-30 12:56:24 -06:00
Yevgeny Makarov af316d2761 UI: Cleanup spelling of compound words
Approximately 138 changes in the spelling of compound words
and proper names like "Light Probe", "Shrink/Fatten", "Face Map".
In many cases, hyphens were used where they aren't correct, like
"re-fit". Other common changes include:
 - "Datablock" -> "data-block"
 - "Floating point" -> "floating-point"
 - "Ngons" -> "n-gons"

These changes help give the language used in the interface
a consistent, more professional feel.

Differential Revision: https://developer.blender.org/D9923
2020-12-24 13:11:22 -06:00
Yevgeny Makarov 2917f550ca Cleanup: Fix capitalization in various UI strings
Approximately 195 changes of capitalization to conform to MLA title style.
UI labels and property names should use MLA title case, while descriptions
should be capitalized like regular prose, generally with only the start of
a sentence capitalized.

Differential Revision: https://developer.blender.org/D9922
2020-12-24 11:07:32 -06:00
Peter Fog 5a69f70751 VSE: Add options to select neighboring handles
Options added to `sequencer.select_handles()` operator.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D7707
2020-12-20 06:23:08 +01:00
Richard Antalik 38b77ef8b2 VSE: Remove cost calculation from cache
This value was meant to be used for keeping images that are slowest to
render in cache. Method of measurement was flawed, because it doesn't
take UI overhead into consideration.

Cache panel is to be removed because users should not have to tweak
settings like this. It is not useful for development either, therefore
it is removed completely.
2020-12-20 03:58:38 +01:00
Richard Antalik a5a302bd18 Cleanup: Split SEQ_sequencer.h file 2020-12-19 07:25:01 +01:00
Richard Antalik 046ca0749a Cleanup: Rename BKE_sequencer functions
API functions get SEQ_ prefix.
Intern functions get seq_ prefix

Functions also have appropriate category included in name.
2020-12-19 06:29:15 +01:00
Richard Antalik d11b219d40 Fix T83869: Crash when creating Sequencer in new scene
Crash on null dereference in `SEQ_timeline_boundbox()`. This function was
generalized in rB9e4a4c2e996c to work on arbitrary `seqbase`.

Fixed by refactoring `SEQ_timeline_boundbox()` functions to return default
sane values if `seqbase` is `NULL`

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D9878
2020-12-17 02:19:34 +01:00
Richard Antalik 5713626422 VSE: Improve motion-picture workflow
This commit resolves problem introduced in e1665c3d31 - it was
difficult to import media at their original resolution.
This is done by using original resolution as reference for scale.

All crop and strip transform values and their animation is converted
form old files.

To make both workflows easy to use, sequencer tool settings have been
created with preset for preffered scaling method. This setting is in
sequencer timeline header and add image or movie strip operator
properties.

Two new operators have been added:
`sequencer.strip_transform_fit` operator with 3 options: Scale To Fit,
Scale to Fill and Stretch To Fill.
Operator can fail if strip image or video is not loaded currently, this
case should be either sanitized or data loaded on demand.

`sequencer.strip_transform_clear` operator with 4 options:
Clear position, scale, rotation and all (previous 3 options combined).

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D9582
2020-12-16 20:38:28 +01:00
Campbell Barton 588f107f11 Cleanup: clang-format 2020-12-16 16:13:05 +11:00
Richard Antalik 977bd7937a Fix warnings introduced in previous commit 2020-12-16 00:20:20 +01:00
Peter Fog fad80a95fd VSE: Add Overlay popover panels
Add panels with overlay settings for strips and preview and overlay
enable/disable button.

Entries from the View menus moved to the overlay panels, which will
simplify cluttered View menus.

Additional options have been added:
 - Strip Name
 - Strip Source(ex. path)
 - Strip Duration

So users can now select what info they need to see on the strips. When
No text is displayed, waveforms are drawn in full height.

Reviewed By: ISS, HooglyBoogly, pablovazquez

Differential Revision: https://developer.blender.org/D9751
2020-12-15 23:50:18 +01:00
Peter Fog dd9d12bf45 VSE: Paste strips after playhead by default
Paste copied strips after playhead, because this is more intuitive.

Previous functionality is still available by enabling "Keep Offset"
property, or under shortcut Ctrl+Shift+V.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D9734
2020-12-15 22:30:01 +01:00
Richard Antalik 9e4a4c2e99 VSE: Move remove gaps operator logic to module code
Logic was broken into finding gaps and ofsetting strips.
Functions were modified so they work on explicitly defined seqbase,
so they can be used as python API functions.

Functional changes:
 - Improve performance by calculating gap length and offseting strips
   at once. Previously strips were offset by one frame.
 - Calculate gap from start frame. Previously gap was considered only
   inbetween strips.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9730
2020-12-15 21:49:15 +01:00
Campbell Barton e035d7301c Fix crash sliding effect sequence strips
Off by one error in array access.
2020-12-15 16:14:59 +11:00
Erik Abrahamsson f7223d5f72 UI: Allow theming the alternate row color in the sequencer
Previously, the alternate row color in the Video Sequence Editor was
just a shaded version of the editor's background color. This makes it
theme-able just like in the file browser and outliner, although the
default color is very slightly different.

Differential Revision: https://developer.blender.org/D9634
2020-11-25 16:37:33 -05:00
Richard Antalik abe95fbdff Cleanup: refactor sequencer_edit.c file
Move RNA enums and utility functions closer to operator definition.

No functional changes.
2020-11-19 13:04:17 +01:00
Sybren A. Stüvel ae64898147 Cleanup: fix bad comment separator
Replace `* /` with `*/` to actually end the comment. As it was, the code
compiled but caused an "`/*` in comment" warning.

No functional changes.
2020-11-19 11:04:30 +01:00
Richard Antalik e5df87b1b9 Cleanup: split sequencer_edit.c file
Move proxy operator functions to own file.

No functional changes.
2020-11-19 09:54:40 +01:00
Richard Antalik 8ec6b34b8e VSE: Move split operator logic to module code
Code was rewritten to work on per-sequence basis returning reference to
created strip.

There should be no functional changes.

Selection logic is left as is for now. I could simplify it, but it
belongs to operator, not split logic.

Reviewed By: sergey

Differential Revision: developer.blender.org/D9592
2020-11-19 05:31:40 +01:00
Hans Goudey 9d28353b52 Cleanup: Make panel type flag names more clear
The overlap with the `Panel` flags that start with "PNL" was quite
confusing because wasn't clear which enum a flag was from. The
new names are a bit longer, but the clarity is worth it.
2020-11-13 13:57:20 -05:00
Richard Antalik 1e7d29b012 Cleanup: rename time related variables
Variables renaned:
 - cfra -> timeline_frame
 - nr -> frame index
 - cfra_over -> overlap_frame

Function seq_give_stripelem_index was renamed to seq_give_frame_index.
2020-11-06 15:13:53 +01:00
Campbell Barton 2d803d3f6d Cleanup: use STR_ELEM macro 2020-11-06 15:42:03 +11:00
Campbell Barton aa3a4973a3 Cleanup: use ELEM macro 2020-11-06 12:32:54 +11:00
Richard Antalik d837923a56 VSE: cache performance optimization
Map frame for cached raw images to strip input media frame range. This
means that static images or extended frame range of movies will only
generate one cache entry.

timeline_frame is stored in cache key as a reference - on what frame
was this entry created, so we don't have to reverse lookup frame range.

Since each media frame corresponds to one cache frame with same frame
index key, there is no need to invalidate raw cache when changing time
remapping properties like use_reverse_frames or strobe

No changes are needed for disk cache, since invalidating raw entry
assumes all data will be invalidated.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9462
2020-11-05 15:55:17 +01:00
Richard Antalik 2a6a26bbd7 Rename extern rendering and proxy functions
Replace BKE_sequencer wirh SEQ_render or SEQ_proxy prefixes.
In cases where function is very generic, only SEQ prefix is used.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9439
2020-11-05 14:05:25 +01:00
Julian Eisel c067b7460a Fix C operators can't set default display or sort type for File Browser
`WM_operator_properties_filesel()` allows C operators to set a display or sort
type for the File Browser to use. But the File Browser would always override
that because of an invalid `_is_set()` check. (The operators don't actually set
the value, they only set the property's default value.)

The only operator affected by this is "Recover Auto Save". It is supposed to
show a vertical list ordered chronologically. It used settings from the
previous File Browser usage before this patch.

Operators using the File Browser should generally use
`FILE_DEFAULTDISPLAY`/`FILE_SORT_DEFAULT` now, except if they have a reason not
to. See comments at their definition.

----

This makes it so operators that set a different display or sort type
don't change the sort or display type for the next File Browser operation.
So using "Recover Auto Save" entirely isolates display and sort type from other
operations.

Differential Revision: https://developer.blender.org/D8598

Reviewed by: Bastien Montagne
2020-11-03 00:00:41 +01:00
Richard Antalik ea1c5a6c15 Rename BKE_sequencer.h
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9349
2020-11-01 21:10:36 +01:00
Yevgeny Makarov 622b30225a UI: Capitalization Corrections
Approximately 141 changes of capitalization to conform to MLA title style.

Differential Revision: https://developer.blender.org/D8392

Reviewed by Julian Eisel
2020-10-24 11:42:17 -07:00
Harley Acheson d1eefc4215 Spelling: Then Versus Than
Corrects incorrect usages of the words 'then' and 'than'.

Differential Revision: https://developer.blender.org/D9246

Reviewed by Campbell Barton
2020-10-19 08:43:08 -07:00
Harley Acheson 3a7fd309fc Spelling: It's Versus Its
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.

Differential Revision: https://developer.blender.org/D9250

Reviewed by Campbell Barton
2020-10-19 08:12:33 -07:00
Richard Antalik 2c14a950a7 Fix T81594: Unable to reassign effect inputs
This was caused by canceling operator if strip has more than 0 inputs.
Logic should be reversed - cancel only if strip has 0 inputs.

BKE_sequencer_render_loop_check() arguments had to be sanitized because
seq_effect_find_selected() can set seq1,2,3 to NULL

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9197
2020-10-17 07:01:12 +02:00
Clément Foucault 57de568604 Fix T81004 Python: Images drawn in the Sequence Editor have wrong colors
This was caused by the sequencer using a sRGB buffer without using
the sRGB transform.

This patch make it so that the framebuffer is rebound using the
sRGB transform before the python draw callbacks.
2020-10-14 18:53:41 +02:00
Campbell Barton 2abfcebb0e Cleanup: use C comments for descriptive text
Follow our code style guide by using C-comments for text descriptions.
2020-10-10 22:04:51 +11:00
Richard Antalik 18d7aeacf2 Move sequencer sources from blenkernel
This is first step of refactoring task T77580.
Next step will be breaking up files into smaller ones.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D8492
2020-10-05 02:58:56 +02:00
Richard Antalik c514357358 Fix T80397: Select Side not working correctly
Test for side on which strip is was incorrect.
2020-10-05 02:29:47 +02:00
Richard Antalik d12ff69320 Rename eSpaceSeq_Proxy_RenderSize members
Remove word proxy from eSpaceSeq_Proxy_RenderSize members if proxy is
not used with that item. Otherwise this can be a bit confusing.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8861
2020-10-05 02:24:51 +02:00
Sybren A. Stüvel 90a27d5aa9 Cleanup: Use enum for return values in context callbacks
Define enum `eContextResult` and use its values for returns, instead of
just returning 1, 0, or -1 (and always having some comment that explains
what -1 means).

This also cleans up the mixup between returning `0` and `false`, and `1`
and `true`. An inconsistency was discovered during this cleanup, and
marked with `TODO(sybren)`. It's not fixed here, as it would consititute
a functional change.

The enum isn't used everywhere, as enums in C and C++ can have different
storage sizes. To prevent issues, callback functions are still declared
as returning`int`. To at least make things easier to understand for
humans, I marked those with `int /*eContextResult*/`.

This is a followup of D9090, and is intended to unify how context
callbacks return values. This will make it easier to extend the approach
in D9090 to those functions.

No functional changes.

Differential Revision: https://developer.blender.org/D9095
2020-10-02 18:56:25 +02:00
Clément Foucault 13c7df1054 Fix T80193 Sequencer: Crash on float images when OCIO GLSL shader can't be used
This was just an oversight from refactoring this code in
rBfaeaf5325554e37981424ded5add7bf2df484c55
2020-09-15 15:22:26 +02:00
Clément Foucault 6432fa488a Cleanup: Remove GLEW dependencies outside of GL module 2020-09-12 15:51:21 +02:00