Forum Replies Created
-
You’re welcome!
The thing you see is because when self-referencing in an expression like taking “valueAtTime” of current layer it actually references to the static value. So it goes to zero because the static value (the value you get when expression is off) for “thisSlider.valueAtTime(time-framesToTime(1))” is zero. I.e. if you turn off the expression, set slider value to be, say, 13 and turn on expression again, it will now be switching to 13 instead of zero.What you basically need is to have the time of the most recent up-skip, so you can just reference it as “boom.valueAtTime(LAST_UP_SKIP_TIME)”.
For that I would suggest switching your approach to what Dan has posted below. It actually works with that LAST_UP_SKIP_TIME (well, not time but frame number technically) under the “frame” variable.
All you need is to change the last “if” expression in Dan’s code to:
...
if (frame == 0){
value;
}else{
boom.valueAtTime(framesToTime(frame))
} -
I see here a whip following the dots.
Dots are animated and arranged in a strict order which can be done one way or another:

Running a coarse line through them can be done with createPath():

Smoothing it is a different problem which I don’t really know how to address.
I can do some smoothing with a version of a script from here: https://forums.creativecow.net/thread/2/1134161 like this:

But as you see, it differs from the gif. All I’m sure is that that line on the gif is smoothed not with Auto Bezier.
-
My shot will be:
2) Have a “DC Boom” (discreet-constant) slider:

– which equals 1 if boom>3 and 0 otherwise:
effect("Boom")("Slider")>3 ? 1 : 0;3) Have a “Delta Boom” slider:

– which equals 1 on those frames only, on which DC Boom switches from 0 to 1:
dcBoom = effect(“DC Boom”)(“Slider”);
delta = Math.max(dcBoom.valueAtTime(time) - dcBoom.valueAtTime(time-framesToTime(1)), 0);4) Have an “Integrated Delta Boom” slider:

– which counts those switches till current time:
db = effect("Delta Boom")("Slider");var numofSkips = 0;
for (i = 0; i<= timeToFrames(time); i++){
if (db.valueAtTime(framesToTime(i))) numofSkips++;
};numofSkips;
5) Implement it for Rotation like this:
idb = thisComp.layer("Controls").effect("Integrated Delta Boom")("Slider")seedRandom(idb,true);
pick4 = Math.round(random(3));
if(pick4 == 0){0}
else if(pick4 == 1){90}
else if(pick4 == 2){180}
else if(pick4 == 3){270};Seems to work as you’ve described.
-
>Why is there a white line around displacement map.
Not really familiar with this effect, but as far as I know, it displaces pixels of base layer based on brightness (I assume, you use that kinde of mode) of map layer. The most bright moves one direction, the most dark – to the other, while pixels close to medium brightness don’t move a lot.Thus, at -4000 everything but pixels really close to medium brightness has moved away. I presume, if you check the color of those white pixels on the map, they would be [128, 128, 128] color or something.
Here’s a shape filled with strictly horizontal gradient moving a solid with fractal noise. When increasing Max Vertical Displacement, the dynamics are quite simple:

All white goes max up, all black goes max down, medium things fall in between.
At extreme levels the only pixels visible on the comp will be those near the center of grad:

So I suppose, those lines of yours are areas of constant color=[128, 128, 128]. They look like lines due to the nature of your map, but generally can be whatever. For instance, here is a circle of [128, 128, 128] color added to that +5000 Max Vertical Displacement setup above:

-
Oleg Pirogov
February 14, 2019 at 12:39 pm in reply to: What is faster? Time remapping or valueAtTime?So, I’ve made some trim path animation and two comps:
Comp 1: valueAtTime(time-30) for trim path
Comp 2: precomped the layer and shifted both Time Remaping keyframes 30 sec forward.Render time:
Comp 1: 1:42, 1:41
Comp 2: 0:49, 0:48So my conclusion would be: WOW, expressions seem to be much slower than time remapping when I expected it to be the other way around.
-
Oleg Pirogov
February 14, 2019 at 12:16 pm in reply to: I’m trying to achieve looping Y movement on a clip using scriptsYou’re welcome, though on the second thought what you really need is this:
1) A slider for Speed called “Speed”.
2) A second slider to compute distance (called “Distance”) based on keyframe integration of Speed done by world-famous Dan Ebbert’s script. This goes to second slider’s expression:
spd = effect("Speed")("Slider")
n = spd.numKeys;
if (n > 0 && spd.key(1).time < time){
accum = spd.key(1).value*(spd.key(1).time - inPoint);
for (i = 2; i <= n; i++){
if (spd.key(i).time > time) break;
k1 = spd.key(i-1);
k2 = spd.key(i);
accum += (k1.value + k2.value)*(k2.time - k1.time)/2;
}
accum += (spd.value + spd.key(i-1).value)*(time - spd.key(i-1).time)/2;
}else{
accum = spd.value*(time - inPoint);
}
value + accum[Here’s: https://www.motionscript.com/articles/speed-control.html – an explanation why you need it and what problems you would encounter if you tried to change speed directly with a slider in my previous expression]
3) The final expression for position:
yTop = 60;
yBase = 900;y = yBase-effect("Distance")("Slider")%(yBase-yTop)
x = value[0];
[x,y] -
Oleg Pirogov
February 14, 2019 at 11:46 am in reply to: I’m trying to achieve looping Y movement on a clip using scriptsWell, this:
yTop = 60;
yBase = 900;
period = 10t = ((time - inPoint)%period)/period;
y = yBase+(yTop-yBase)*tx = value[0];
[x,y]Makes the layer to go from yBase to yTop in period seconds and the start all over again from yBase.
-
Oleg Pirogov
February 14, 2019 at 2:05 am in reply to: I’m trying to achieve looping Y movement on a clip using scriptsIf I wanted to make a loop like this, I would rather animate that one upward moving and then use loopOut() expression to loop it till the end of the comp.
Anyway, about the expression:
1) There’s a layer property called “velocity”, so you can’t just use it as a variable name. I’m not even sure why your AE doesn’t give you an error when you assign “velocity = -300”, as velocity property is a vector and -300 is not. Anyway, better pick some other name.
2) It says at the bottom, because (time – inPoint) keeps growing, so it’s always (y<60) and thus y being set to 900; -
Oleg Pirogov
February 14, 2019 at 1:20 am in reply to: Dynamically change 3D light color based on pixel colorAs far as I understand it, sampleImage method does exactly what you need.
This goes to light’s color property expression:thisComp.Layer("Concert Video Footage Layer").sampleImage(SELECTED_PIXEL_COORDINATES, radius = [.5, .5], postEffect=true, t=time)radius allows you to set a pixel range.
-
It’s mostly Text Animators, as I see it, not effects.
It’s “Animate” menu against Text property of every text layer.
