Ben Robinson
Forum Replies Created
-
Ben Robinson
November 13, 2017 at 9:01 pm in reply to: Expression error: unclosed token, have no idea what it isAwesome! Thank you. I don’t think I’ve used the && statement before–so obviously wasn’t aware of the syntax.
Thanks for your help.
-
Ben Robinson
November 13, 2017 at 2:39 pm in reply to: Expression error: unclosed token, have no idea what it isWhat was the answer to this? I’m getting a similar error, but can’t work out why…?
-
Ben Robinson
January 30, 2017 at 11:07 pm in reply to: Triggering random expression with another layer’s propertyThanks Dan. That works perfectly. So, it turns out, did another method I’d already arrived at–possibly even from one of your own, after much reading / experimenting…
ctrl = comp("MAIN COMP").layer("TIMING CONTROLS");
segDur = framesToTime(ctrl.effect("On Time (Frames)")("Slider"))+framesToTime(ctrl.effect("Fade In/Out Time (Frames)")("Slider")*2);
minVal = inPoint;
maxVal = framesToTime(37);seed = Math.floor(time/segDur);
seedRandom(seed,true);
random(minVal,maxVal);
Even though it wasn’t directly linked to the opacity it was linked to the same duration-setting sliders. For some reason, though, it wasn’t working for a couple of days. Not sure if I’d mistyped / mis-linked something or what–but the opacity and frame change just didn’t marry up. I like your method with the direct link to the opacity though. Seems like it will give more consistency.
Thanks
Ben
-
Ben Robinson
January 27, 2017 at 12:48 pm in reply to: Looping opacity with set fade up/down and “stay on” durationsOk, so it turns out I hadn’t solved my own problem after all–mainly because it’s not just the opacity expression I need; I also need to time remap a random freeze frame and a random colour change (from a set palette) at the same time as the fade up / fade down–basically a new frame / colour every time opacity reaches zero. On top of that, a second layer also needs to randomly change colour over the same period as fade up / fade down.
I’ve confused myself with all of that–and it’s my project! Maybe an actual description will help…
I have a set of icons (currently 38, but could increase), all 1 frame in length, in a 38 frame precomp. Around that precomp is a border. I want to randomly select a frame from the icon precomp and hold on it for a set amount of time (ideally set by a slider in a master comp) and have it fade out over a set time (again on a slider) then change frame and colour (via a Tint / Fill effect) then fade up again (same as fade out time). Meanwhile the border will, as the icon fades out / in, change from one random colour to another (without fading in / out).
I have some of this working–but can’t get the timing of each change to coincide, even though the timings are all supposedly linked to the same master sliders…
Current fade in/out code (this seems to work as I want it to):fadeTime = framesToTime(comp("MAIN COMP").layer("TIMING CONTROLS").effect("Fade In/Out Time (Frames)")("Slider"));
seedRandom(comp("MAIN COMP").layer("TIMING CONTROLS").effect("Random Seed")("Slider"), true);
onTime = framesToTime(comp("MAIN COMP").layer("TIMING CONTROLS").effect("On Time (Frames)")("Slider"))*random(1,2);
fadeDur = fadeTime*2+onTime;
t = time%fadeDur;
fadeInOpacity = linear(t, inPoint, inPoint+fadeTime, 0, 100);
fadeOutOpacity = linear(t, fadeTime+onTime, fadeDur, 100, 0);
(fadeInOpacity * fadeOutOpacity) / 100Time remap code (works, but timing is off with above opacity change):
segDur = comp("MAIN COMP").layer("TIMING CONTROLS").effect("On Time (Frames)")("Slider")/25+comp("MAIN COMP").layer("TIMING CONTROLS").effect("Fade In/Out Time (Frames)")("Slider")/25;
minVal = inPoint;
maxVal = framesToTime(37);seed = Math.floor(time/segDur);
seedRandom(seed,true);
random(minVal,maxVal);Colour change (this, again, works, but timing doesn't match--works well as transition for border, but not for icon colour change):
colors = [[49,32,28,255]/255,
[0,175,170,255]/255,
[221,0,49,255]/255,
[172,0,51,255]/255,
[255,108,27,255]/255,
[220,143,27,255]/255];
easeTime = framesToTime(comp("MAIN COMP").layer("TIMING CONTROLS").effect("Fade In/Out Time (Frames)")("Slider"));
segDur = framesToTime(comp("MAIN COMP").layer("TIMING CONTROLS").effect("On Time (Frames)")("Slider"))*2;curSeg = Math.floor(time/segDur);
t = time%segDur;
seedRandom(curSeg,true);
idx1 = Math.floor(random(colors.length));
seedRandom(curSeg-1,true);
idx0 = Math.floor(random(colors.length));
ease(t,0,easeTime,colors[idx0],colors[idx1]) -
Hi Dan,
I realise this thread is nearly a year old now–but I think it relates to what I’m looking for. I’m looking to do the same thing as the OP: move one layer’s position to another layer’s (possibly in another comp) position, according to its index; but I’d like to able to control / trigger it with keyframes (a slider on a null, perhaps) rather than have it automated. Additionally, I’d like to be able to apply this to several layers, but–let’s say they’re all controlled by a slider on a null layer (i.e., one controller for several layers)–offset the timing they each start animating.
Hope that makes sense.
Thank you in advance.
Ben
-
That works a treat now.
Thanks Xavier.
-
Hi Xavier,
I see what you mean about the array. It was my impression that an operation on an array automatically affect all elements of the array, unless otherwise separated. Obviously not.
I’m still confused about the only positive value expression. i think I did enter my original expression incorrectly in the first post, where I had, “…layer(“2nd Comp Name”)…” rather than, “…layer(“Layer Name”)…” So should my expression look like this:
x=comp(“Comp Name”).layer(“Layer Name”).transform.scale-index*[1,1]
(x>0) ? x : 0;Other than including the array multiplier, that is what I input and got the previously mentioned error.
Thanks for your help here.
Ben
-
Hi,
Applying the expression as you’ve suggested…
x=comp(“Comp Name”).layer(“Layer Name”).transform.scale-index;
(x>0) ? x : 0…returns the following error:
Expression result must be of dimension 2, not 1. Am I missing something?
Also, I’ve just noticed that even the straightforward linking expression
comp(“Comp Name”).layer(“Layer Name”).transform.scale-index
is only affecting the width value; i.e. the index value is only subtracted from the width, not width and height. Why might that be?
-
Thanks very much for your help / reply. Haven’t had a chance to plug in your expressions yet–will let you know when I do.
Thanks again.
-
Ok. I worked out that, because the layer I want to control is nested in a nested comp, I had to alter your expression somewhat and add another variable as such:
C = comp(“Main Comp”);
C2 = comp(“Sub Comp”);
L – C2.layer(thisComp.name);
C.layer(“Null”).transform.position.valueAtTime(time+L.startTime)Works a treat. I’m reasonably pleased with myself for working that out–but all credit goes to you Dan.
Thanks very much.