Simon Francois
Forum Replies Created
-
Hi all, hi Remco,
I’ve been Lucky enough to find your script as it was the perfect answer to problem I have. Though, the script doesn’t work for me and I get an error message saying:
Cannot read property ‘match’ of undefined
The error is said to be on line 18 (the script I use i the same the original post mentioned atop).The .srt files I work with are well formated. I checked that may times, and even threw them in AME to see if it could render proper empty subtitled MP4 files, and it did very well.
Trying and failing, I was wondering if it wasn’t me just being stubborn and whether there would be any other method via Premiere or different scripts that could get me there, but doing it directly in AE would be very convenient, since I’m placing it in animations I’m designing, and have to keep an eye on the text layout amd how everything fits together, being able to move things if required by legibility.
Also, doing it by hand is no option since I have to deliver 17 of them, 10 to 15 seconds long, byt the end of this Week.
Any thoughts on that?
Thanks a lot in advance,
Simon -
Simon Francois
April 27, 2016 at 6:00 pm in reply to: Moving an object to a random but preset positionHi Dan, and thanks a lot again, but I’m not sure to understand how I make use of the destArray further in the script… How shall I refer to it?
-
Simon Francois
April 27, 2016 at 4:04 pm in reply to: Moving an object to a random but preset positionNew attempt, still not working…
segDur = .5;// duration of each "segment" of random motion//for StartVal
pArray = [[960, 300],
[666, 300],
[1254, 300],
[862, 460],
[1058, 460],
[666, 780],
[1254, 460]];
endVal = pArray[Math.floor(random(pArray.length))];//for [960, 300]
pArray1 = [[862, 460],
[1058, 460]];
endVal1 = pArray1[Math.floor(random(pArray1.length))];//for [862, 460]
pArray2 = [[960, 300],
[666, 300],
[1254, 780],
[666, 780]];
endVal2 = pArray2[Math.floor(random(pArray2.length))];//for [1058, 460]
pArray3 = [[960, 300],
[1254, 300],
[1254, 780],
[666, 780]];
endVal3 = pArray3[Math.floor(random(pArray3.length))];//for [666, 300]
pArray4 = [[862, 460],
[666, 780]];
endVal4 = pArray4[Math.floor(random(pArray4.length))];//for [1254, 300]){
pArray5 = [[1254, 780],
[1058, 460]];
endVal5 = pArray5[Math.floor(random(pArray5.length))];//for [666, 780]
pArray6 = [[862, 460],
[666, 300]];
endVal6 = pArray6[Math.floor(random(pArray6.length))];//for [1254, 780])
pArray7 = [[1254, 300],
[1058, 460]];
endVal7 = pArray7[Math.floor(random(pArray7.length))];seed = Math.floor(time/segDur);
segStart = seed*segDur;
seedRandom(seed,true);
startVal = pArray[Math.floor(random(pArray.length))];
seedRandom(seed+1,true);if(startVal==[960, 300]){
ease(time,segStart,segStart + segDur, startVal, endVal1);
}if(startVal==[862, 460]){
ease(time,segStart,segStart + segDur, startVal, endVal2);
}if(startVal==[1058, 460]){
ease(time,segStart,segStart + segDur, startVal, endVal3);
}if(startVal==[666, 300]){
ease(time,segStart,segStart + segDur, startVal, endVal4);
}if(startVal==[1254, 300]){
ease(time,segStart,segStart + segDur, startVal, endVal5);
}if(startVal==[666, 780]){
ease(time,segStart,segStart + segDur, startVal, endVal6);
}if(startVal==[1254, 780]){
ease(time,segStart,segStart + segDur, startVal, endVal7);
} -
Simon Francois
April 27, 2016 at 10:12 am in reply to: Moving an object to a random but preset positionSo, here is the thing. Aiming for a slightly more complex situation (hereinabove mentioned), I’ve tried the following script. It is wrong and doesn’t work at all, but at least I think it shows what I’m trying to achieve:
The end value (the final position of the dot after each travel), depends on where it starts, and therefore, depending on the value of “startVal”, “endVal” goes to randomly pick in preset arrays of positions that restrict its possibilities for each step it takes.Thanks for any help, I know it looks quite clumsy…
segDur = .5;// duration of each "segment" of random motion//for StartVal
pArray = [[960, 300],
[666, 300],
[1254, 300],
[862, 460],
[1058, 460],
[666, 780],
[1254, 460]];//for [960, 300]
pArray1 = [[862, 460],
[1058, 460]];//for [862, 460]
pArray2 = [[960, 300],
[666, 300],
[1254, 780],
[666, 780]];//for [1058, 460]
pArray3 = [[960, 300],
[1254, 300],
[1254, 780],
[666, 780]];//for [666, 300]
pArray4 = [[862, 460],
[666, 780]];//for [1254, 300]){
pArray5 = [[1254, 780],
[1058, 460]];//for [666, 780]
pArray6 = [[862, 460],
[666, 300]];//for [1254, 780])
pArray7 = [[1254, 300],
[1058, 460]];seed = Math.floor(time/segDur);
segStart = seed*segDur;
seedRandom(seed,true);
startVal = pArray[Math.floor(random(pArray.length))];
seedRandom(seed+1,true);endVal = (if(startVal==[960, 300]){
pArray[Math.floor(random(pArray1.length))];
} if(startVal==[862, 460]){
pArray[Math.floor(random(pArray2.length))];
} if(startVal==[1058, 460]){
pArray[Math.floor(random(pArray3.length))];
} if(startVal==[666, 300]){
pArray[Math.floor(random(pArray4.length))];
} if(startVal==[1254, 300]){
pArray[Math.floor(random(pArray5.length))];
} if(startVal==[666, 780]){
pArray[Math.floor(random(pArray6.length))];
} if(startVal==[1254, 780]){
pArray[Math.floor(random(pArray7.length))];
});ease(time,segStart,segStart + segDur, startVal, endVal);
-
Simon Francois
April 26, 2016 at 11:03 pm in reply to: Moving an object to a random but preset positionThanks Dan, that works very well indeed!
I would like to add one level of complexity though, and in that case, depending on where the dot is, it could only get to certain positions nearby its current.
For instance, within this array of positions, if the dot is currently placed on [960, 540], it could only move to [1058, 460], [862, 460], and [960, 300]. Do you see what I mean?
Then, once it gets to a new position, a few others become available, and a few others not, etc. By moving from a position to another, the restiction list changes.
-
Simon Francois
April 26, 2016 at 5:39 pm in reply to: Moving an object to a random but preset positionHere is my latest attempt, which doesn’t work at all… but still is hopefully something to discuss:
segDur = .5;// duration of each “segment” of random motion
myPos1 = 960, 300
myPos2 = 862, 460
myPos3 = 666, 300
myPos4 = 960, 540
myPos5 = 1058, 460
myPos6 = 1254, 300
myPos7 = 1254, 780
myPos8 = 666, 780seed = Math.floor(time/segDur);
segStart = seed*segDur;
seedRandom(seed,true);
startVal = thisComp.layer(“dot 1”).transform.position;
seedRandom(seed+1,true);
n = Math.floor(random(7)) + 1;
endVal = “myPos.” + n;
ease(time,segStart,segStart + segDur, startVal, endVal); -
Simon Francois
April 26, 2016 at 5:19 pm in reply to: Moving an object to a random but preset positionThe formalize it more simply, the idea is to randomly select a preset position, then I think, the script I found on Dan’s website can do the rest (the smooth motion toward the position).
Any idea about the above?
-
Simon Francois
April 26, 2016 at 11:24 am in reply to: Moving an object to a random but preset positionOne of the closest solution i’ve found is from Dan Ebberts’ website
https://www.motionscript.com/mastering-expressions/random-1.html
Based on that example, I would like to have a bunch of dots shuffling their position every second, with a smooth motion, not in a jump (like in Dan’s example called “random motion – synchronized”). -
Simon Francois
November 11, 2015 at 11:34 pm in reply to: Random rotation of multiples of 90°, every secondHa that’s right, I always mistake (0-4) for (O, 4).
Thanks a lot! Greetings,
Simon -
Simon Francois
November 11, 2015 at 11:26 pm in reply to: Random rotation of multiples of 90°, every secondThanks Dan, it’s perfect, as usual!
What was wrong in my script? Was it missing the Math.floor?