-
Timeline segmentation
Hi guys,
So I am looking at good techniques for segmenting the timeline. The intention comes from a current project where I have a Colorama (the artist is quite happy with the default 6-part hue cycle) colouring an object and cycling through time. Now, where this gets challenging is that the object fades up, cycles and fades down, with the fading up colour matching the first and the fading down colour matching the last colour in the cycle (effecting doubling that colour). Also the colour offsets by one each cycle.My approach was to cut the timeline up into “segs” as is throughout the code. If the time was inside certain segments, then certain functions would be called. The only problem I’ve had is that this feels a little clunky and the colour cycling doesn’t work properly. It gets to the right area and then kind of sawtooths between one colour and the next one in the sequence (weirdly offset correctly in each repetition of the cycle).
Does anyone know of a more effective way to create “regions” within the timeline or, just as a side note, why my cycling doesn’t work properly?
(This was attached to the “Input Phase” parameter of “Colorama”.
If the attached code makes no sense, I can do an annotated version explaining my madness.
Cheers,
RurycompLen = thisComp.duration;
numCols = 6;
numHoldSegs = 2;
numSubSegs = numCols + numHoldSegs;
numReps = 6;
currentRep = 0;
currentSeg = 0;
numSegs = numSubSegs * numReps;
segLen = compLen/numSegs;
t = time;
segNum = 0;
val = 0;
maxVal = 360;
defVal = 0;
intSeg = 0;for(i = 0; i< numSegs; i++){
minim = i * segLen;
maxim = i * (segLen + 1);
if(t >= minim && t << maxim){ segNum = i; } } for(j = 0; j
