Page MenuHome

Adjust Scene sequence strips in VSE editors when the start or end position of a referenced scene is changed
Needs ReviewPublic

Authored by Olly Funkster (Funkster) on Oct 28 2016, 1:09 PM.

Details

Summary

References T49862

Currently if you add a Scene to the VSE, and then adjust the start or end frames of the scene, the contents of the strip in the VSE is not updated (e.g. if you have made the scene longer, you cannot access the new frames in the scene strip). Adding the scene again would give a different result.

This patch finds any VSE strips referencing the modified scene and adjusts the source length and end still / offset values to produce a result that is the same as if you added the scene to the VSE after making the change, with the exception that it does not change the length of the scene strip itself (because it might bump into nearby strips and be forced onto another channel).

To get exactly the same strip as adding again from scratch, the user will have to drag the end marker to suit, but this is simple because the VSE will show an updated green area representing the source scene's range.

Simple demo here:
https://www.youtube.com/watch?v=08ovpPVXatY

Diff Detail

Repository
rB Blender

Event Timeline

Olly Funkster (Funkster) retitled this revision from to Adjust Scene sequence strips in VSE editors when the start or end position of a referenced scene is changed.
Olly Funkster (Funkster) updated this object.
Olly Funkster (Funkster) set the repository for this revision to rB Blender.
Olly Funkster (Funkster) removed rB Blender as the repository for this revision.

I realised there was a bug in my linked-list traversing that meant it would never look at the last one in the list. Now fixed.

Moved logic out of rna_scene and into one generic function in sequencer.c

Would someone care to review this one also? Thanks!

Would someone care to review this one also? Thanks!

Sure, thanks for notifying.
I want to take this sequentially, so it will all take some time...

I should perhaps create some task to collect all patches pending.

I think this change will be problematic when adding more strips from the same scene using ex. different cameras. I personally do not want the scene-strips to inherit or be limited by any duration from the scene's preview/render ranges. That duration should only be determined by the length of the strip in the sequencer(and not limited to or changed by the range currently in that scene), but that's just my opinion.

Agree, I don't think this should be done at all. This can break things without the user realizing.

source/blender/blenkernel/intern/sequencer.c
5745–5747

Using this trick to access global data is not good, if you're going to access all scenes you should pass in main so it's clear that this function affects more than the one scene.

I see this as user-specific feature also.

It may have place as a python addon bound on scene sfra/efra change with user confirmation dialog.
That would be probably even more hackish, but at least not hard-coded.

Could someone provide a worked example of where this would be a problem, but where that problem would not be experienced when adding the scene a second time? I think it's important that old and new strips of the same scene behave consistently - and if you don't want them to change, all you need to do is simply leave your scene start and end where they are.

Could someone provide a worked example of where this would be a problem, but where that problem would not be experienced when adding the scene a second time? I think it's important that old and new strips of the same scene behave consistently - and if you don't want them to change, all you need to do is simply leave your scene start and end where they are.

First of all as Brecht said, "This can break things without the user realizing."
Without user realizing is the key for me.

"This patch finds any VSE strips referencing the modified scene and adjusts the length"
So it can for example force a strip to change channel possibly leading to change in output. Can ruin final render without user previewing, because "I didn't touch the sequencer"

Oh, it doesn't change the length of the strip - it changes the length of the source scene that is contained within that strip (which is a copy, and currently it only inherits at the point the strip is created). It will never bump the scene strip onto a different channel. This is perhaps poorly worded in my description.

Demo here:
https://www.youtube.com/watch?v=08ovpPVXatY

Oh, it doesn't change the length of the strip - it changes the length of the source scene that is contained within that strip (which is a copy, and currently it only inherits at the point the strip is created). It will never bump the scene strip onto a different channel. This is perhaps poorly worded in my description.

Demo here:
https://www.youtube.com/watch?v=08ovpPVXatY

Thanks, for demo,
This seems to be ok.
I will compare behavior - not used to use scenes.

But in principle seems OK, I would change still frames to be very visible(distinct), but this is TODO for UI

Ok, in that case it makes sense. So is the intent for the sequencer output to remain unchanged when changing a scene start/frame, and only providing a visual indication for the user to update it to match?

At the moment it seems as if changing the end frame keeps the sequencer output the same, while this is not the case for the start frame. Would it make sense and be possible to do the same for both?

Ok, in that case it makes sense. So is the intent for the sequencer output to remain unchanged when changing a scene start/frame, and only providing a visual indication for the user to update it to match?

It is more than visual in many cases. If you change the end frame of the source scene to a larger number, then it basically has no immediate effect on the scene strip (until you go and grab the right hand end marker and drag it to the right).

However if you change the scene end frame to a smaller number, you could potentially be putting still frames at the end of the scene strip. If you change the scene start frame in either direction, it will move the contents of the scene strip sideways accordingly. In both cases the result is the same as if you were to create another scene strip set to the same range, but it would change the render result of sequencers - which if you weren't paying attention and e.g. set your scene start/end to a tiny range in order to do a test render, could cause confusion if you didn't put the start/end back to where it "should" be.

At the moment it seems as if changing the end frame keeps the sequencer output the same, while this is not the case for the start frame. Would it make sense and be possible to do the same for both?

I think that would just be introducing some extra inconsistency - it should either do nothing, or it should behave like a new strip.

Maybe a button on the properties panel for the scene strip for "refresh strip from scene" would be safer.

Diff updated for 2.8 branch (in included file, cannot modify this directly)
Omitted include DNA_sequence_types.h in rna_scene.c - No DNA sequence type has been used

BUG:

  • add scene strip
  • cut scene strip
  • change sfra / efra
  • select left cut strip
  • use slide(G) operator
  • strip changes length

Yeah, easy fix, but, we need proper framework for this :)
I will write some task for this, at least to clear head RAM. It would be simple, so even beginner(such as me :) can do it.

Olly Funkster (Funkster) updated this revision to Diff 13776.EditedWed, Feb 20, 9:38 PM

Updated diff to build against 2.8 / current master

EDIT: argh, sorry, you'd already done that and I didn't remove the extra include. Will sort.