ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Marker Animation Error

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Lok
Marker Animation Error
on Jan 10, 2018 at 2:41:46 am

The plugin named "Flow" can create smooth animations with it's Bézier curve graph tool, by two ways: "Apply to Keys"or"Apply to Expression",the I choose the latter one, and apply to two position keys.After that, it create an expression like that:


n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time) n--;
if (n == 0 || n == numKeys) value;
else
easeQuint (time, key(n).time, key(n+1).time,
key(n).value, key(n+1).value);
} else { value; }

//--------- Flow Expression Code ---------//
function easeQuint(t,tMin,tMax,value1,value2)
{
z=arguments;
if(z.length!==5)return value;
a=z[4]-z[3];
b=z[2]-z[1];
c=clamp((z[0]-z[1])/(b/2),0,2);
if(c<1)
return a/2*Math.pow(c,5)+z[3];
c-=2;
return a/2*(Math.pow(c,5)+2)+z[3];
}
;
//--------- Flow Expression Code ---------//


Then I want to change all key. to marker. , so I can animate without keyframes,but by adding markers(shortcut : control+8 or "*"key on numpad).And now I have to add Point Controls that tells it move from here to there.

n = 0;
if (marker.numKeys > 0) {
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
if (n == 0 || n == marker.numKeys) value;
else
easeQuint (time, marker.key(n).time, marker.key(n+1).time,
effect("Point Control")("Point"), effect("Point Control 2")("Point"));
} else { value; }

//--------- Flow Expression Code ---------//
z=arguments;
if(z.length!==5)return value;
a=z[4]-z[3];
b=z[2]-z[1];
c=clamp((z[0]-z[1])/(b/2),0,2);
if(c<1)
return a/2*Math.pow(c,5)+z[3];
c-=2;
return a/2*(Math.pow(c,5)+2)+z[3];
//--------- Flow Expression Code ---------//


And it jumps an ERROR:

After Effects warning: Expression disabled. Error at line 1 in property ‘Position’ of layer 1 (‘MarkerAnimation’) in comp ‘MarkerAnimation’.
property or method named ‘thisProperty’ in Class ‘global’ is missing or does not exist. It may have been renamed, moved, deleted, or the name may have been mistyped.

It makes the footage twinkles like a star on my screen.I took a long time to solve this problem.I found the positive solution: Separate the arrays.


a = effect("Point Control")("Point")[0];
b = effect("Point Control")("Point")[1];

c = effect("Point Control 2")("Point")[0];
d = effect("Point Control 2")("Point")[1];

n = 0;
if (marker.numKeys > 0) {
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
if (n == 0 || n == marker.numKeys) value;
else
easeQuint (time, marker.key(n).time, marker.key(n+1).time,[a,b],[c,d]);
} else { value; }

//--------- Flow Expression Code ---------//
z=arguments;
if(z.length!==5)return value;
a=z[4]-z[3];
b=z[2]-z[1];
c=clamp((z[0]-z[1])/(b/2),0,2);
if(c<1)
return a/2*Math.pow(c,5)+z[3];
c-=2;
return a/2*(Math.pow(c,5)+2)+z[3];
//--------- Flow Expression Code ---------//


It works, but why?


Return to posts index

Dan Ebberts
Re: Marker Animation Error
on Jan 10, 2018 at 6:01:48 am

It might have worked if instead of this:

effect("Point Control")("Point")

you used this:

effect("Point Control")("Point").value

Dan



Return to posts index

John Lok
Re: Marker Animation Error
on Jan 10, 2018 at 8:46:54 am

BTW, I use the Expression pick whip (inserts a reference to target) to refer a point control , so it can't be a numerical value, but an array.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]