Eric Sanderson
Forum Replies Created
-
uh oh, so i think i spoke too soon. Its weird because before i would get the error by just applying the blue to the cube…but i just got it again with the new code only saying theres no property or method for “deltaX”, and it only appeared after enabling the motion blur preview for the comp.
-
That did the trick, so what happened there? Was it that in the previous code AE saw “start” as the beginning of the comp (frame 0)…and with the new one you just took the guess work out for AE and told it 0? And somewhere along the lines motion blurs sub frame sampling confused it.
-
oh i see, so to make sure…if i were to put it in a sentance would it sound like…
“Out of the numbers being generated by the frames(0-90 in his example), only return the numbers equal to the number of layers in the comp(0-9).”.?
So it doesnt matter if its whole numbers or not, modulos just takes from it what you tell it to?
-
tt = timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false); i = index-1 if(i == tt){ 100 }else{ 0}If yours is starting on frame 2 than you have a layer above all of your scripted layers in your timeline. if its an adjustment layer or something that needs to be on top than in your “index” spot put “index – 1”..id make a variable though.
And for the looping im sure there is a code but the only code i know off the top of my head only loops set keyframes. I would just pre-comp the scripted layers and dup those.
Only thing i can think of is theres got to be a way to call out the index # plus its multiple of 10 (for 9 layers)…Dan?
-
it took a few more min. but here ya go.
tt = timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false);
if(index == tt){
100
}else{
0} -
oops…replace the “==” with “<"
-
if(index == time){ 100 }else{ 0}is it really going to change each frame? instead of linear id start with an if/else statement using the index. for example…(see code)…but that turns them on every second and leaves them on, im no Dan Ebbert so ill need a few min to play around with it if off and on every frame is what you want lol. But maybe this can get you started in the right path.
-
Eric Sanderson
October 1, 2008 at 6:27 pm in reply to: run expression every 2 frames.. every 3 frames etc?probability = 3; r = (random(-probability+2,1)); v = clamp(r,0,1): s = random(500,-500; x = s[0]; y = s[1]; position + [x,y]
here is the code you would use pertaining to your project…let me know how it works
-
Eric Sanderson
October 1, 2008 at 6:22 pm in reply to: run expression every 2 frames.. every 3 frames etc?…sorry, it copied weird…the 2nd and 3rd line shown there is actually all on one line.
-
Eric Sanderson
October 1, 2008 at 6:21 pm in reply to: run expression every 2 frames.. every 3 frames etc?probability = 3; r = (random(-probability+2,1)); //determines how often it wiggles, -4,1= 1/6th of the time with a clamp of 0,1 v = clamp(r,0,1); s = wiggle(10, 400*v); x = value[0]; y = s[1]; [x,y]
You can define variable probability using random and a clamp, heres an example that i did using text not to long ago…this code only wiggles on the Y.