Sequencer: restructuring the code layout #77580

Open
opened 2020-06-07 20:59:49 +02:00 by Richard Antalik · 24 comments

Note: This is initial proposal aimed to gather feedback. It is subject to change.

This is task to coordinate restructurization of majority of VSE code.
Goal is to break existing code to smaller files with relatively narrow scope, create layer isolating low-level BKE code from functions close to user (operators, RNA, drawing). There should be minimum functional changes in first stages, followed by cleanups with minor functional changes if necessary (logic consolidation).

Motivation:

  • Maintainability in general
  • To allow work on #59540, where it is important for drawing, RNA and operator code to follow exact same logic to produce correct results.
  • Make it easier and cleaner to make changes in rendering code

Since this will be relatively large operation, it will have to be done in few stages:

Note: This is initial proposal aimed to gather feedback. It is subject to change. This is task to coordinate restructurization of majority of VSE code. Goal is to break existing code to smaller files with relatively narrow scope, create layer isolating low-level BKE code from functions close to user (operators, RNA, drawing). There should be minimum functional changes in first stages, followed by cleanups with minor functional changes if necessary (logic consolidation). Motivation: - Maintainability in general - To allow work on #59540, where it is important for drawing, RNA and operator code to follow exact same logic to produce correct results. - Make it easier and cleaner to make changes in rendering code Since this will be relatively large operation, it will have to be done in few stages: - [x] Move sequencer code from BKE. - 18d7aeacf2 - [x] Split sequencer code into smaller chunks - 3baf65975c - 0f43fe7fa6 - 01db805a82 - a5a302bd18 - e5df87b1b9 - [x] Rename / refactor sequencer code - ea1c5a6c15 - 2a6a26bbd7 - 046ca0749a - [ ] Move as much as possible lower-level code from operators and RNA. - 8ec6b34b8e - 9e4a4c2e99 - TODO: - sequencer_add.c ([D9760: VSE: Refactor VSE strip loading code](https://archive.blender.org/developer/D9760)) - sequencer_edit.c (got multiple smaller patches for this file as well) - sequencer_select.c - rna_sequencer.c - [ ] Refactor operator and RNA code moving remaining low-level logic. Aim for limiting logic to iteration and calling sets of functions from "libraries". - 13ca11ac52 - TODO: - Add RNA API functions to sequencer API
Richard Antalik self-assigned this 2020-06-07 20:59:49 +02:00
Author
Member

Added subscriber: @iss

Added subscriber: @iss
Member

Added subscriber: @ankitm

Added subscriber: @ankitm

Added subscriber: @StanislavOvcharov

Added subscriber: @StanislavOvcharov

Added subscriber: @razcore

Added subscriber: @razcore
Contributor

Added subscriber: @pistolario

Added subscriber: @pistolario

Added subscriber: @ManuelAlbert

Added subscriber: @ManuelAlbert

Added subscriber: @Pipeliner

Added subscriber: @Pipeliner

Added subscriber: @DuarteRamos

Added subscriber: @DuarteRamos

Added subscriber: @AndyCuccaro

Added subscriber: @AndyCuccaro

Added subscribers: @brecht, @Sergey

Added subscribers: @brecht, @Sergey

Generally is super nice to have sequencer better organized from the code point of view, and de-duplicate logic as much as possible.

As for the locations of the files I don't think they belong to editors. Editor API should not be used by render pipeline, for example. To me it seems that sequencer should become more top-level folder, like compositor is, and used by render pipeline, sequencer space and so on.

As for the approach of how to structure the changes:

  • Try to move files as-is to the neighbourhood of their destination
  • Split them up at their final destination

Moving files can happen as a bulk operation, since that'd be annoying to keep incrementally modify entire source code. Splitting up and other changes try to keep as isolated as possible, in a stream of commits.

For the planing, it seems like this is an involved change, and we have quite reasonable amount of reports which doesn't seem to be requiring such refactor. To me it seems for 2.90 is better to do stabilization pass, and aim this refactor for 2.91. Hence i'll place this to 2.91 column. Surely, some work can start early on, but finalized (with all the cleanup and de-duplication you've mentioned) is unlikely to happen for 2.90 due to time constraints.

This is my vision anyway. Since there is some source layout/etc involved, wouldn't mind if @brecht shares his strong opinion :)

Generally is super nice to have sequencer better organized from the code point of view, and de-duplicate logic as much as possible. As for the locations of the files I don't think they belong to editors. Editor API should not be used by render pipeline, for example. To me it seems that sequencer should become more top-level folder, like `compositor` is, and used by render pipeline, sequencer space and so on. As for the approach of how to structure the changes: * Try to move files as-is to the neighbourhood of their destination * Split them up at their final destination Moving files can happen as a bulk operation, since that'd be annoying to keep incrementally modify entire source code. Splitting up and other changes try to keep as isolated as possible, in a stream of commits. For the planing, it seems like this is an involved change, and we have quite reasonable amount of reports which doesn't seem to be requiring such refactor. To me it seems for 2.90 is better to do stabilization pass, and aim this refactor for 2.91. Hence i'll place this to 2.91 column. Surely, some work can start early on, but finalized (with all the cleanup and de-duplication you've mentioned) is unlikely to happen for 2.90 due to time constraints. This is my vision anyway. Since there is some source layout/etc involved, wouldn't mind if @brecht shares his strong opinion :)

+1 to everything @Sergey said.

+1 to everything @Sergey said.
Author
Member

Thanks for input, I agree with all points here, so I will change description with more discrete steps that can be checked out. Will have to look at compositor code organization, but I suspect that I will probably want to keep alloc/free functions in BKE if I wanted to make strip a ID at some point.

Thanks for input, I agree with all points here, so I will change description with more discrete steps that can be checked out. Will have to look at compositor code organization, but I suspect that I will probably want to keep alloc/free functions in BKE if I wanted to make strip a ID at some point.

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @VincentGires

Added subscriber: @VincentGires

Added subscriber: @tintwotin

Added subscriber: @tintwotin

Just curious, as I see a lot of files being moved around now for this project, but has the advantages of moving the Sequencer data out of Scene data, so Scenes can be switched without switching Sequencer contents, and vice versa, been taken into consideration?
{F8860684, size = full}

Some of the benefits:

  • Having the sequencer scene strip preview in the 3d view((no switching)good for storyboarding, previz etc.
  • A source and a master edit preview in the same workspace(as the VSE 2.0 mock-up, but both previews are Sequencer previews(just different Sequences))
  • Pancake editing workspace(all footage in one sequence and all edited material in another) in the same workspace.
  • Accessing sequencer-data-block from everywhere like node editor, 3d view background(ex. grease pencil drawing on edited sequence) and texture material, which can be manipulated in node editor and returned to VSE as scene strip.

{F8860669, size=full}

More on the advantages here on RCS: https://blender.community/c/rightclickselect/kWbbbc/

Just curious, as I see a lot of files being moved around now for this project, but has the advantages of moving the Sequencer data out of Scene data, so Scenes can be switched without switching Sequencer contents, and vice versa, been taken into consideration? {[F8860684](https://archive.blender.org/developer/F8860684/image.png), size = full} Some of the benefits: - Having the sequencer scene strip preview in the 3d view((no switching)good for storyboarding, previz etc. - A source and a master edit preview in the same workspace(as the VSE 2.0 mock-up, but both previews are Sequencer previews(just different Sequences)) - Pancake editing workspace(all footage in one sequence and all edited material in another) in the same workspace. - Accessing sequencer-data-block from everywhere like node editor, 3d view background(ex. grease pencil drawing on edited sequence) and texture material, which can be manipulated in node editor and returned to VSE as scene strip. {[F8860669](https://archive.blender.org/developer/F8860669/comp2vse2.gif), size=full} More on the advantages here on RCS: https://blender.community/c/rightclickselect/kWbbbc/

I fully support Peter's proposal of moving the sequencer out of the scene. I've been thinking a lot lately about how the sequencer fits into the Blender file/scene hierarchy (and I'll make a mockup of some ideas I have on this and on the compositor as soon as I can).

In the end, the sequence should be the final step of the production, no? Thus, I think it's more logical to have the sequence be the "parent" of the many scenes within the blend file than the other way around. And, like Peter mentions in his proposal, it could open the gates for a more streamlined workflow for storyboarding, for example.

Please, please consider doing this change.

I fully support Peter's proposal of moving the sequencer out of the scene. I've been thinking a lot lately about how the sequencer fits into the Blender file/scene hierarchy (and I'll make a mockup of some ideas I have on this and on the compositor as soon as I can). In the end, the sequence should be the final step of the production, no? Thus, I think it's more logical to have the sequence be the "parent" of the many scenes within the blend file than the other way around. And, like Peter mentions in his proposal, it could open the gates for a more streamlined workflow for storyboarding, for example. Please, please consider doing this change.

This task is purely about restructuring the code layout, please move discussion about changes to functionality elsewhere.

This task is purely about restructuring the code layout, please move discussion about changes to functionality elsewhere.
Brecht Van Lommel changed title from Gigantic VSE refactor to Sequencer: restructing the code layout 2020-09-10 17:45:01 +02:00
Brecht Van Lommel changed title from Sequencer: restructing the code layout to Sequencer: restructuring the code layout 2020-09-10 17:45:17 +02:00

In #77580#1013237, @brecht wrote:
This task is purely about restructuring the code layout, please move discussion about changes to functionality elsewhere.

It has been at RCS since aug. 2018, but no devs there to discuss it: https://blender.community/c/rightclickselect/kWbbbc/

> In #77580#1013237, @brecht wrote: > This task is purely about restructuring the code layout, please move discussion about changes to functionality elsewhere. It has been at RCS since aug. 2018, but no devs there to discuss it: https://blender.community/c/rightclickselect/kWbbbc/

Added subscriber: @ideasman42

Added subscriber: @ideasman42

As of 18d7aeacf2 there is:

./source/blender/sequencer/BKE_sequencer.h (outside of ./source/blender/blenkernel).

I think we shouldn't leave partially finished module re-arrangement in this state.

While multiple commits to move and rename can be OK, it's leaving a mess to keep a module split-up and spread across different directories - longer term.

As of 18d7aeacf2 there is: `./source/blender/sequencer/BKE_sequencer.h` (outside of `./source/blender/blenkernel`). I think we shouldn't leave partially finished module re-arrangement in this state. While multiple commits to move and rename can be OK, it's leaving a mess to keep a module split-up and spread across different directories - longer term.
Author
Member

I will clean up that file on one or two commits (split + rename).

There will be still bunch fo functions with BKE prefix, so unless this is done in one go, there will have to be undesirable state for some time.

I will try to resolve this state in first place and as quickly as I can. I already got one file split, but perhaps it would be better to start with BKE_sequencer.h actually - it would make subsequent splits even easier.

I will clean up that file on one or two commits (split + rename). There will be still bunch fo functions with BKE prefix, so unless this is done in one go, there will have to be undesirable state for some time. I will try to resolve this state in first place and as quickly as I can. I already got one file split, but perhaps it would be better to start with `BKE_sequencer.h` actually - it would make subsequent splits even easier.
Contributor

Added subscriber: @ok_what

Added subscriber: @ok_what
Richard Antalik added this to the Video Sequencer project 2023-02-09 20:57:27 +01:00
Philipp Oeser removed the
Interest
VFX & Video
label 2023-02-10 09:32:01 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
16 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#77580
No description provided.