From: "Rick Gerard" Received: from bosmailout07.eigbox.net ([66.96.185.7] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTPS id 7435638 for ae-list@media-motion.tv; Sat, 14 Sep 2019 21:24:02 +0200 Received: from bosmailscan09.eigbox.net ([10.20.15.9]) by bosmailout07.eigbox.net with esmtp (Exim) id 1i9Dh6-0002St-S8 for AE-List@media-motion.tv; Sat, 14 Sep 2019 15:26:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mstrg.com; s=dkim; h=Sender:Message-Id:In-Reply-To:To:References:Date:Subject: Mime-Version:Content-Type:From:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZI124Zh8sYNinDJkmIYTi9BIvdaHPdrDmV1tnBtub2w=; b=Ijz3iRHN/wDJic374GgQYMTvU0 /Gy9Fv0O1KffHTdBIbCsqBFzJ7G9risZfNonOI7fsb6MFqNLEnkSjIUCrgHEjGKB/JNo+9jcfJ++h E7B9VBFlFPguOmgjjoKSf7YTbukFfzeoCy3DfED2xEsYrQ7c5ZYwnRNZGwa50Ze2mPHY5GCpOB580 gpQX/vCj+rJLScxiBeUmWw4q5WUIQ9npQZkVt3+pXOHFDAlyDA5V9qtD0RPyu/sb+7ZaA47QCBCFu hEEoiv51eWFS6nSZPQ1tZDhZrc1+fqfDQL5UoXzJSFu2kvF6mgGhXJfvMejh8rdrt3Hw8olVWrlN6 Xeq4204A==; Received: from [10.115.3.33] (helo=bosimpout13) by bosmailscan09.eigbox.net with esmtp (Exim) id 1i9Dh6-0005Jb-Qe for AE-List@media-motion.tv; Sat, 14 Sep 2019 15:26:52 -0400 Received: from bosauthsmtp02.yourhostingaccount.com ([10.20.18.2]) by bosimpout13 with id 1XSp2100702gpmq01XSsbh; Sat, 14 Sep 2019 15:26:52 -0400 X-Authority-Analysis: v=2.2 cv=McAcg93f c=1 sm=1 tr=0 a=9MP9vxlQrmnoeofDS6o88g==:117 a=+fNCsvVYfgsOWX7dqrClyQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=J70Eh1EUuV4A:10 a=MOoPLM9SH6MA:10 a=RqOAJGx8AAAA:8 a=STdfrDHf3wwPEqIRFasA:9 a=U2ML-vgftsNfvxNR:21 a=5Nhxkr6eCKTahPEn:21 a=QEXdDO2ut3YA:10 a=PsK3-0o9DseSF8sUs2cA:9 a=IXHllxYAwPFFfQEK:21 a=_W_S_7VecoQA:10 Received: from [69.4.147.69] (port=60230 helo=[192.168.1.4]) by bosauthsmtp02.eigbox.net with esmtpa (Exim) id 1i9Dh3-0005Yr-Fg for AE-List@media-motion.tv; Sat, 14 Sep 2019 15:26:49 -0400 Content-Type: multipart/alternative; boundary="Apple-Mail=_DF7E4AEE-D1CC-4DD1-9CDC-363AD25CF993" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [AE] long string of random nimbers Date: Sat, 14 Sep 2019 12:26:45 -0700 References: To: After Effects Mail List In-Reply-To: Message-Id: <96016E05-3034-4B3B-BAFF-46BF4BA08A31@mstrg.com> X-Mailer: Apple Mail (2.3445.104.11) X-EN-UserInfo: 606e7e322a7bd4687933c0d4b2502703:931c98230c6409dcc37fa7e93b490c27 X-EN-AuthUser: rick@mstrg.com Sender: Rick Gerard X-EN-OrigIP: 69.4.147.69 X-EN-OrigHost: unknown --Apple-Mail=_DF7E4AEE-D1CC-4DD1-9CDC-363AD25CF993 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Here are a few basics:=20 The randomI() method generates a random number between 0 and 1 The random seed is based on the layer number unless you specify it If you don=E2=80=99t mind not having a zero appear in the first column a = simple linear(t, tMin, tMax, value1, value2) will generate random = numbers. Adding Math.floor, or round to the result of the linear method will = eliminate the decimal point. EZ solution for 7 digets: t =3D random(); value =3D linear(t, .00000001, 1, 1000000, 9999999); Math.floor(value) You can make as many digits ad you like. If you want leading zeros the = expression gets a lot more complicated: t =3D random(); value =3D linear(t, .00000001, 1, 0, 9999999); nums =3D Math.floor(value) // The new stuff amtOfZeroes =3D 7;// match the largest number above isNeg =3D false; if(nums < 0) { nums =3D Math.abs( nums ); isNeg =3D true; } sVal =3D Math.round( nums ) + ""; while(sVal.length < amtOfZeroes) { sVal =3D "0" + sVal;=20 } if(isNeg) sVal =3D "-" + sVal; sVal Rick_Gerard = --Apple-Mail=_DF7E4AEE-D1CC-4DD1-9CDC-363AD25CF993 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Here are a few = basics: 
The randomI() method generates a random = number between 0 and 1
The random seed is based on = the layer number unless you specify it
If you = don=E2=80=99t mind not having a zero appear in the first column a simple = linear(t, tMin, tMax, value1, value2) will generate random = numbers.
Adding Math.floor, or round to the result = of the linear method will eliminate the decimal point.

EZ solution for 7 = digets:
t =3D random();
value =3D linear(t, .00000001, 1, 1000000, = 9999999);
Math.floor(value)

You can make as many = digits ad you like. If you want leading zeros the expression gets a lot = more complicated:

t =3D random();
value =3D = linear(t, .00000001, 1, 0, 9999999);
nums =3D = Math.floor(value)
// The new stuff

amtOfZeroes =3D 7;// = match the largest number above

isNeg =3D false;
if(nums < 0)
{
nums =3D Math.abs( nums );
isNeg =3D = true;
}
sVal =3D Math.round( = nums ) + "";
while(sVal.length < = amtOfZeroes)
{
sVal =3D "0" + = sVal; 
}
if(isNeg)
sVal =3D "-" + sVal;

sVal




= --Apple-Mail=_DF7E4AEE-D1CC-4DD1-9CDC-363AD25CF993--