-
AE Duik Plugin Error
Hello,
I am working with Duik plugin for After Effect and it is suddenly giving me an error which it never gave me before.
It keeps saying..
invalid numeric result(divided by zero?) expression disabled.
I am not expert on coding- Found this lines. But not sure what’s the problem. The message says error is on the line 23… I looked into the same error message in this forum, but cannot figure out how to apply the answers to this specific Duik problem. Any thought/insight will be appreciated.boneracine = “2_L_rear_leg”;
bonebout = “2_L_rear_foot”;
zero = “IK_zero 2_L_rear_foot”;
controleur = “C_2_L_rear_foot”;
if (thisComp.layer(controleur).effect(“IK Orientation2_L_rear_leg”)(1) == 1) {cw = true}else{cw=false}
function getWorldPos(theLayerName){
L = thisComp.layer(theLayerName);
return L.toWorld(L.anchorPoint);
}
function oriente(a, b, P) {
return ((b[0]-a[0])*(P[1]-a[1]) – (P[0]-a[0])*(b[1]-a[1]) );
}
A = getWorldPos(boneracine);
B = getWorldPos(bonebout);
C = getWorldPos(zero);
E = getWorldPos(controleur);
a = length(B,C);
b = length(E,A);
c = length(A,B);
x = (b*b + c*c – a*a )/(2*b);
alpha = Math.acos(clamp(x/c,-1,1));
y = b – x;
gamma = Math.acos(clamp(y/a,-1,1));
result = (cw ? 1 : -1)*radiansToDegrees(gamma + alpha); V1 = B – A;
adj1 = radiansToDegrees(Math.atan2(V1[1],V1[0]));
V2 = C – B;
adj2 = radiansToDegrees(Math.atan2(V2[1],V2[0]));
result + adj1 – adj2 + value;