Thread: Avisynth+
View Single Post
Old 26th August 2019, 03:09   #4838  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
This might be a very odd and niche feature request, but here goes...

In ConditionalReader, the OFFSET command offsets all lines below it a fixed number of frames, but it can be overwritten by another OFFSET command. My request is to add a new command, something like ADDOFFSET (or if you can think of a better name), where it doesn't overwrite previous offsets, but adds its offset to the previous one.

For example:
Code:
  # This is for frame 0, obviously
0 value0
OFFSET 2
  # This is for frame 3: 1 + offset 2
1 value1
  # This adds 4 to the previous offset of 2
ADDOFFSET 4
  # So this is now for frame 8: 2 + offsets 2+4
2 value2
  # And this will overwrite the previous offset(s), as before
OFFSET 10
  # So this is for frame 13: 3 + offset 10
3 value3

edit: Or maybe you could call it by
Code:
OFFSET+=4
  # and of course also
OFFSET-=4
  # while maybe even adding the possibility to write
OFFSET=2
edit2:
And for the motivation of this... say you have a long list of values for sequential frames, but then you need to add gaps here and there. With the current implementation of OFFSET, you can't change one gap without having to also change every OFFSET after it, and you can't directly read what the gap is without having to subtract the previous OFFSET.

Last edited by ajp_anton; 26th August 2019 at 03:29.
ajp_anton is offline