[Bf-committers] S-DNA and Changes

Campbell Barton ideasman42 at gmail.com
Thu Nov 25 17:30:00 CET 2010

On Thu, Nov 25, 2010 at 4:12 PM, Leo Sutic <leo.sutic at gmail.com> wrote:
> Hi all,
> I've now started to dig into the codebase - and the VSE in particular.
> The workings seem fairly straightforward, but as far as changing things
> I must ask your advice.
> The "problem" is the S-DNA representation of the VSE data. The
> structures used in the VSE, and also written to the blend file, are
> strongly coupled to the current workings of the VSE. Not an
> unsurmountable obstacle, but something which requires extra care when
> changing things.
> So, my question is this: How has this been handled historically? I can't
> be the first one to run into this. For the sake of argument: Suppose I
> want to make really big changes to the VSE - should I...
>  1. Write a "VSE 2" and create all-new structures?
>  2. Create some kind of "compatibility loader" or data import filter
> that converts the old data to the new, as far as possible? That is, we
> read old and new formats, but only write new format.
>  3. Convert the old structs to the new in-memory? That is, we read and
> write the old format, maybe with some back-compatible changes, but use a
> new format internally?
> /LS

All the options you proposed are possible.
1) This was done with our animations system, 2.4x IPO's to FCurves, in
most cases this is not trivial even for experienced developers, this
is handled in readfile.c's do_versions(), but Id say only do this if
all else fails.

2) possible too though I cant think of any examples off hand were
blender does this, save and load is used for undo so if this become
common place it could make blenders undo too slow.

3) This is what's done for editbones & editmesh, depends on what you
intend to do so can't say if this is a good option for the VSE.

Even though I'm not sure what you would want to improve, I also ran
into problems with the VSE's structure being cumbersome with
expressions like:
 ((seq->start+seq->len) + seq->endstill) - seq->endofs;
just to work out the end of a strip, so I added seq_tx_get/set
functions, Perhaps adding access functions which give more logical API
is a solution too.

- Campbell

More information about the Bf-committers mailing list