Commit Graph

187 Commits

Author SHA1 Message Date
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
Campbell Barton 588f107f11 Cleanup: clang-format 2020-12-16 16:13:05 +11: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
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
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
Sybren A. Stüvel fb5e2f5610 Cleanup: Clang-Tidy bugprone-incorrect-roundings fixes
Should cause no noticeable difference.
2020-09-04 16:23:08 +02:00
Sergey Sharybin 6fe609d4c3 Sequencer: Implement zoom-to-fit view mode
In this mode the preview image is always using the most of the preview
area space: it is scaled to fit, preserving aspect ratio. This makes it
possible to always have maximum of the preview region even after resize
of other areas.

This mode is enabled by default, is available in the View -> Zoom to Fit
menu. It is enabled when View All (Home key) is used, and is disabled
when manual navigation ([panning, zooming) is performed.

There is no versioning code, which means existing files will open as-is,
but new projects will have this option enabled.

Ref T78987

Maniphest Tasks: T78987

Differential Revision: https://developer.blender.org/D8549
2020-08-13 15:24:21 +02:00
Jacques Lucke 675fa2ee13 Refactor: rename SpaceType->new to SpaceType->create
The data member `new` was conflicting with the `new` keyword
when `BKE_screen.h` was included in C++ files.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D8459
2020-08-04 14:40:15 +02:00
Campbell Barton 901ee66ea1 Cleanup: use term init instead of initialize/initialise
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
2020-08-01 13:51:05 +10:00
Sybren A. Stüvel 35ce16939c Cleanup: Editors/Space/sequencer, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/space_sequencer` module.

No functional changes.
2020-07-03 17:42:45 +02:00
Jeroen Bakker bbb2e0614f Performance: Draw play head as an overlay
When playing back animations a playhead is updated in all the animation editors.
The drawing of the playhead is part of the drawing of the main region
`RGN_TYPE_WINDOW` that redraws the whole region.

This change will draw the play head and window scrollers when updating the
screen. This affects the Action editor, Timeline, Graph editor, NLA editor and
Sequence editor. There is noticeable speedup when using complex animation files.

Spring 02_020_A.anim.blend fps went from 11.8 to 12.5 when showing a timeline
and a action editor on a Ryzen 1700.

* When playing back animation the markers don't jump up/down when near the
  frame. This could be added back.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D8066
2020-06-23 12:03:17 +02:00
Richard Antalik d0d20de183 VSE: Draw f-curves for opacity and volume values on the strips
Feature can be enabled or disabled in timeline view menu item "Show F-Curves".

Author a.monti

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D7205
2020-04-06 00:52:29 +02:00
Richard Antalik 0d0036cb53 Cleanup: Fix comment style and check if they are valid or make sense. 2020-04-05 23:55:51 +02:00
Richard Antalik 43cc2f3195 Cleanup: Use `_fn` as a suffix for callbacks in VSE code 2020-04-05 23:39:20 +02:00
Julian Eisel 905c0269f3 Cleanup: Rename ScrArea variables from sa to area
Follow up of b2ee1770d4 and 10c2254d41, part of T74432.
Now the area and region naming conventions should be less confusing.

Mostly a careful batch rename but had to do few smaller fixes.

Also ran clang-format on affected files.
2020-04-03 13:34:50 +02:00
Julian Eisel 10c2254d41 Cleanup: Continue renaming ARegion variables from ar to region
Continuation of b2ee1770d4, now non-single word variables are also
renamed.
Part of T74432.

Also ran clang-format on affected files.
2020-04-03 12:54:28 +02:00
Campbell Barton 2bc791437e Cleanup: use 'r_' prefix for output arguments
Also pass some args as 'const'.
2020-03-25 17:58:58 +11:00
Richard Antalik e1c7549ac9 Fix T75019: Frame Offset does not apply to scopes
Don't check for `sseq->mainb == SEQ_DRAW_IMG_IMBUF`.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7228
2020-03-25 00:09:14 +01:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Julian Eisel b2ee1770d4 Cleanup: Rename ARegion variables from ar to region
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.

This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.

Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.

Also ran clan clang format on affected files.
2020-03-06 17:19:23 +01:00
Jeroen Bakker 297261eb90 CodeCleanup: Added enums to opengl render functions
Motivation the functions get 3 different kind of flag parameters (ImBuf,
DrawType, OffscreenRendering) the naming of the flags were not clear,
leading to mistakes and unnecessary time spend debugging.
2020-03-06 12:11:55 +01:00
Bastien Montagne 56116bbdf4 Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.

Part of T72604.
2020-02-10 13:00:42 +01:00
Julian Eisel 8a7859b9ad Fix T73428: Editor type dropdown menu missing in VSE
Mistake in 6a49161c8c, the tool-header region was not created when
creating a new VSE editor (as opposed to an existing one in some
workspace).

There was also no way to get the tool-header to show in such cases.
2020-01-27 11:21:35 +01:00
Richard Antalik 6a49161c8c VSE: Tool system integration
Add toolbar to sequencer regions.

A bit of refactoring has to be done in RNA space.
Currently there is only cut tool implemented to serve as template for
anybody who would like to add more.
2020-01-22 15:06:18 +01:00
Richard Antalik a4cf2cf2de VSE: Add Adjust Last Operation panel to the video sequencer
Add Adjust Last Operation panel to Sequencer.

`OPTYPE_REGISTER` was removed form some operators and few properties were hidden
So they don't show up on the panel

Author: a.monti

Reviewed By: ISS

Differential Revision: http://developer.blender.org/D6210
2020-01-22 02:07:54 +01:00
Alessio Monti di Sopra dc87d09b8b UI: allow to hide markers region per editor
Instead of having the option to show marker lines,
make the marker region optional.

- Added a Show Markers entry in the View menu of the animation editors.
- If the markers region is not active then the Marker menu gets hidden.
- Removed marker menu from the driver editor
  and don't allow to use marker operators.
2019-11-30 17:08:04 +11:00
Jacques Lucke a1aa4a2597 RNA: Cleanup PointerRNA struct
The old layout of `PointerRNA` was confusing for historic reasons:
```
typedef struct PointerRNA {
  struct {
    void *data;
  } id;

  struct StructRNA *type;
  void *data;
} PointerRNA;
```

This patch updates it to:
```
typedef struct PointerRNA {
  struct ID *owner_id;
  struct StructRNA *type;
  void *data;
} PointerRNA;
```

Throughout the code base `id.data` was replaced with `owner_id`.
Furthermore, many explicit pointer type casts were added which
were implicit before. Some type casts to `ID *` were removed.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D5558
2019-08-23 09:52:12 +02:00
Campbell Barton 8f565f5a6f WM: reuse visible region calculation
Avoids calculating the visible part of a region whenever
on-screen overlays are drawn.
2019-08-16 06:44:25 +10:00
Brecht Van Lommel 966dbddf3d Fix sequencer sidebar not being wide enough by default to show timecodes 2019-06-20 19:00:51 +02:00
Campbell Barton a9450dbf0d Gizmo: add 2D navigation for image/clip/sequencer views 2019-05-31 21:51:02 +10:00
Brecht Van Lommel 8fdbd1377e Sequencer: ensure Strip is the default active panel 2019-05-22 19:52:41 +02:00
Brecht Van Lommel e39737f166 UI: make sidebars in 3D view and other editors a little wider and consistent 2019-05-15 16:17:23 +02:00
Jacques Lucke 3b9813fe50 UI: Move scrollbars to the right in animation editors
The text, that was in the scrollbars, stays on the left.

Reviewers: brecht, billreynish

Differential Revision: https://developer.blender.org/D4821
2019-05-08 15:16:05 +02:00
Jacques Lucke f2b7582b27 UI: Animation editor scrubbing area
The main reason for this change is to allow setting the
active frame with the left mouse button, while still being
able to select e.g. keyframes with the same mouse button.

The solution is to introduce a new scrubbing region with
a specialized keymap. There are a couple of related todos,
that will be handled in separate commits.
Those are listed in D4654.

This solves T63193.

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

Reviewers: brecht, billreynish
2019-05-07 15:09:14 +02:00
Richard Antalik 337cac760b VSE: Cache rewrite
This patch implements new cache system.
Aim is to give user more control over cache, so it can be maximally
utilized. This is done through sequencer timeline side panel
in category proxy & cache.
Cached images are also visualized in timeline, controled by
sequencer timeline view->cache menu

Functional changes:
 - NOT use IMB_moviecache API
 - refactor names of cached image types
 - each scene owns 1 sequencer cache
 - merge preprocess cache into per-sequencer cache
 - cache links images rendered per frame in order as they are created
 - add cache content visualization tool
 - add RNA properties to control the cache

More info can be found in design notes in blenkernel/intern/seqcache.c
and in https://developer.blender.org/D4443

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4443
2019-04-28 14:50:48 -07:00
Jacques Lucke ea80264381 Refactor: allow event handlers to have a poll function
Previously only a fixed bounding box could be used.
This was not flexible enough.
T63193 will benefit from this refactor.

Reviewers: brecht, campbellbarton
2019-04-24 17:34:48 +02:00
Campbell Barton 690ed63eb5 Cleanup: unused region init functions 2019-04-18 20:02:09 +02:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton ce3b78c73a Cleanup: style, use braces for editor/spaces 2019-03-26 21:16:47 +11:00
Richard Antalik 005626b8c6 Refactors preview drawing code with few functional modifications:
Fix T61241

 - Changing preview size does not affect drawn image size, only resolution.
 -- Consistent behavior, when changing full-size / proxy / scene render size
 -- Scopes are rendered in *same size* as source image
 -- Over all, user does not have to readjust preview zoom.

Reviewed by: Brecht

Differential revision: https://developer.blender.org/D4315
2019-02-27 13:48:27 -08:00
Campbell Barton 702a2ba0ef Cleanup: quiet undeclared variable warnings 2019-02-23 19:20:20 +11:00
Jacques Lucke 3b3eba6374 Markers: Make marker lines in sequencer and graph editor optional
- Makes it possible to show a vertical line for every marker in the graph editor.
- Makes the marker line visiblity optional in the sequencer and graph editor.

Request from @hjalti.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4348
2019-02-18 10:42:06 +01:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Richard Antalik a451d4abbc Fix T59644: FPS meter not showing in VSE
Issue caused probably by typo
2018-12-21 16:27:08 -08:00
Campbell Barton 9ea645862c Preferences: add option for header position
Sets the header position for newly created windows with few exceptions
(preferences is always bottom, file-selector is always top).
2018-12-14 09:54:34 +11:00
Brecht Van Lommel c39f34def9 Fix Cycles viewport render info overlapping other text.
Now it shows more compact info below the view/object name. Render time and
memory usage is left out, as in most cases this is not so important. These
could be added back optionally if needed.
2018-11-08 18:31:33 +01:00
Bastien Montagne 64ec05b64d Cleanup: remove some useless BKE_library and BKE_main includes.
Makes it simpler to make some changes...

Also fix order of some includes (use alphabetical please).
2018-11-07 20:58:54 +01:00