Return-Path: Received: from moutng.kundenserver.de ([212.227.126.186] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 4563000 for AE-List@media-motion.tv; Wed, 14 Dec 2011 13:21:59 +0100 Received: from oxltgw05.schlund.de (oxltgw05.schlund.de [172.19.158.43]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0LalfU-1QqVuD2OQC-00kLDy; Wed, 14 Dec 2011 13:28:01 +0100 Date: Wed, 14 Dec 2011 13:28:01 +0100 (CET) From: "mylenium@mylenium.de" Reply-To: "mylenium@mylenium.de" To: After Effects Mail List Message-ID: <2102653292.393643.1323865681402.JavaMail.open-xchange@email.1und1.de Subject: Re: [AE] smooth keyframes expression MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_393642_2143638781.1323865681246" X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v- X-Provags-ID: V02:K0:n00ELxe0RBets1AoaRVzoDzBFJSjdgDKyPu5RJEB1kw a5tQE51l8VZ4pxG8EuNcYkEuZUB/wI1fW+y7SSMmt+4AZJBHS4 P3V5Zy5GR1roPAVetTkV9XPcsvu5WeYh+MOnHRV3LOH4H0u5F6 XXfomL0wmK+gVPvv2tYBboN/39u/9JBKy6HsONbJQXEHPqvUi7 CdD7A7Xwa2GuBriVyTJUvTPqSsP7stLDXpJgyPe1hbDIXNr13f ydSGVNe05VtpMewIagiHBDxz1Fs135DHzWSQ6LObMb78nWcN1i jmghvS4OvdOQZNAk3WVpNBfvZ/G29+yDWfiMpO5LfWcG0vOnQ7 7Q4RT+YZgJ/xL5qYAhrWevm9KFZZMWzJIHIljqW1LLUUpC5rgL 59ePPmyehDTtnqvKRHOKPR5vok44mPmTPUdOHf2RD0+1UcTY1G PRxG6 ------=_Part_393642_2143638781.1323865681246 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To add to what I just wrote: You are trying to get the time value outside t= he valueAtTiem() function, that's why it doesn't work. Use the syntax I sugges= ted rather than using the extra variables afterwards. Mylenium [Pour Myl=C3=A8ne, ange sur terre] ----------------------------------------- www.mylenium.de ---------- Urspr=C3=BCngliche Nachricht ---------- Von: "mylenium@mylenium.de" An: After Effects Mail List Datum: 14. Dezember 2011 um 13:23 Betreff: Re: [AE] smooth keyframes expression valueAtTime() evaluates time, so the keyframes don't matter. Keyframe indic= es on the other hand start at 1... Anyway, use p.valueAtTime(f)[0] to address the= X component only. That's the only obvious issue I can see on a quick glance..= . =C2=A0 Mylenium =C2=A0 =C2=A0 [Pour Myl=C3=A8ne, ange sur terre] ----------------------------------------- www.mylenium.de =C2=A0 Sascha Gritz hat am 14. Dezember 2011 um 13:14 geschriebe= n: > Dear list, > sorry for the wrong subject I used for the last email. > We=C2=A0 got the following problem: > we track a point and give the tracked position data (x,y) to a null > object. What we want to do now is write an adjustable expression that > compares the values of the tracked data from frame to frame that > determines changes in position that are above a specific threshold. Only > if a change in position is beyond this threshold, movement should take > place. > > We put the expression on the keyframed transform.position of our > null-object. > but it seems it isn't working. > > The error we get at this point is that valueAtTime(0) is undefined. > Although there is a Keyframe at frame 0; > since we step from error to error, there must be another problem. > > By the way, the smooth function on the other hand is not an option, > because it produces, in regard to our footage, not a fitting movement. > > here is what we tried: > > ------------------------------ > CODE > ------------------------------ > > p =3D transform.position; > > //we go through the frames and determine if major changes has taken place > > for (f =3D 0; f <=3D timeToFrames(); f++){ > > savepos =3D p.valueAtTime(0);=C2=A0 //error at this line! > > if (timeToFrames(0) =3D=3D 0){ > lastpos =3D savepos; > } > > > // define two points in time to compare values of these two > > now =3D framesToTime(f); > nextnow =3D framesToTime(f+1); > > tempLoc1 =3D p.valueAtTime(now); > tempLoc2 =3D p.valueAtTime(nextnow); > > tempX1 =3D tempLoc1[0]; > tempX2 =3D tempLoc2[0]; > tempY2 =3D tempLoc2[1]; > > threshold =3D 0.5; > > > // if there is a change that is big enough we set the new position, else > it stays as before > > if (tempX1 < tempX2+threshold){ > lastpos =3D [tempX2,tempY2]; > p =3D lastpos; > > }else{ > > p =3D lastpos; > > } > > } > > > ------------ > END CODE > ------------ > > Many thanks in advance, > Sascha > > > -- > __________________________________ > VISION UNLTD. CREATIVE WORX GmbH > > Bruesselerstr. 85 > 50672 Koeln > > Fon +49 (0)221 56978 42 > Fax +49 (0)221 56978 11 > Mob +49 (0)178 7992039 > s.gritz@vucx.de > > check out our web page: www.vucx.de > die medienprofis: www.profigilde.de > > > > +---End of message---+ > To unsubscribe send any message to ------=_Part_393642_2143638781.1323865681246 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

To add to what I just wrote: You are trying to get the time value outside the valueAtTiem() function, that's why it doesn't work. Use the syntax I suggested rather than using the extra variables afterwards.


Mylenium

[Pour Mylène, ange sur terre]
-----------------------------------------
www.mylenium.de


---------- Ursprüngliche Nachricht ----------
Von: "mylenium@mylenium.de" <mylenium@mylenium.de>
An: After Effects Mail List <AE-List@media-motion.tv>
Datum: 14. Dezember 2011 um 13:23
Betreff: Re: [AE] smooth keyframes expression

valueAtTime() evaluates time, so the keyframes don't matter. Keyframe indices on the other hand start at 1... Anyway, use p.valueAtTime(f)[0] to address the X component only. That's the only obvious issue I can see on a quick glance...

 

Mylenium  

 

[Pour Mylène, ange sur terre]
-----------------------------------------
www.mylenium.de

 


Sascha Gritz <s.gritz@vucx.de> hat am 14. Dezember 2011 um 13:14 geschrieben:

> Dear list,
> sorry for the wrong subject I used for the last email.
> We  got the following problem:
> we track a point and give the tracked position data (x,y) to a null
> object. What we want to do now is write an adjustable expression that
> compares the values of the tracked data from frame to frame that
> determines changes in position that are above a specific threshold. Only
> if a change in position is beyond this threshold, movement should take
> place.
>
> We put the expression on the keyframed transform.position of our
> null-object.
> but it seems it isn't working.
>
> The error we get at this point is that valueAtTime(0) is undefined.
> Although there is a Keyframe at frame 0;
> since we step from error to error, there must be another problem.
>
> By the way, the smooth function on the other hand is not an option,
> because it produces, in regard to our footage, not a fitting movement.
>
> here is what we tried:
>
> ------------------------------
> CODE
> ------------------------------
>
> p = transform.position;
>
> //we go through the frames and determine if major changes has taken place
>
> for (f = 0; f <= timeToFrames(); f++){
>
> savepos = p.valueAtTime(0);  //error at this line!
>
> if (timeToFrames(0) == 0){
> lastpos = savepos;
> }
>
>
> // define two points in time to compare values of these two
>
> now = framesToTime(f);
> nextnow = framesToTime(f+1);
>
> tempLoc1 = p.valueAtTime(now);
> tempLoc2 = p.valueAtTime(nextnow);
>
> tempX1 = tempLoc1[0];
> tempX2 = tempLoc2[0];
> tempY2 = tempLoc2[1];
>
> threshold = 0.5;
>
>
> // if there is a change that is big enough we set the new position, else
> it stays as before
>
> if (tempX1 < tempX2+threshold){
> lastpos = [tempX2,tempY2];
> p = lastpos;
>
> }else{
>
> p = lastpos;
>
> }
>
> }
>
>
> ------------
> END CODE
> ------------
>
> Many thanks in advance,
> Sascha
>
>
> --
> __________________________________
> VISION UNLTD. CREATIVE WORX GmbH
>
> Bruesselerstr. 85
> 50672 Koeln
>
> Fon +49 (0)221 56978 42
> Fax +49 (0)221 56978 11
> Mob +49 (0)178 7992039
> s.gritz@vucx.de
>
> check out our web page: www.vucx.de
> die medienprofis: www.profigilde.de
>
>
>
> +---End of message---+
> To unsubscribe send any message to <ae-list-off@media-motion.tv>
------=_Part_393642_2143638781.1323865681246--