FORUMS: list search recent posts

# Duik expression error in After Effects

FAQ   •   VIEW ALL
 Duik expression error in After Effects on Oct 21, 2016 at 3:49:35 pm

Hey Guys,

I'm having a problem with Duik and rigging a character up. I've literally just finished rigging a character and it's working fine, I've designed another character and done the exact same process and I'm getting this error coming up when linking up the leg controller:

When I take a look at the expression this is what I see:

//Duik.twoLayerIK
layer1 = thisComp.layer('
M R Thigh');
layer2 = thisComp.layer('
M R Calf');
controller = thisComp.layer('C_
M R Shoe');
endPos = layer2.effect('IK End')(1);
ctrlEffect = controller.effect("IK
M R Calf")
limit = effect('IK Limit')(1);
FK = ctrlEffect(4);
IKFK = ctrlEffect(3) == 0;
cw = ctrlEffect(1) == 1;
function getWorldPos(L){
return L.toWorld(L.anchorPoint);
}
function ik() {
A = getWorldPos(layer1);
B = getWorldPos(layer2);
C = layer2.toWorld(endPos);
E = getWorldPos(controller);
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));
D = E - A;
delta = Math.atan2(D[1],D[0]);
result = radiansToDegrees(delta - (cw ? 1 : -1)*alpha);
V = B - A;
IK = result - adj1 + value;
if (IK < limit) IK+=360;
return IK;
}
IKFK ? ik() : FK;

When it comes to expressions I'm not really sure what I'm looking for so was wondering if anyone has had this problem and knows how to fix it?

Cheers

Sean

 Re: Duik expression error in After Effectson Oct 21, 2016 at 5:23:56 pm

It looks like you've got several line returns in your layer names. For example, this:

thisComp.layer('
M R Thigh');

should probably be:

thisComp.layer('M R Thigh');

Dan

 Re: Duik expression error in After Effectson Oct 24, 2016 at 3:09:24 pm

Hey Dan,

Cheers for getting back to me, I tried what you said and still the same problem and now another problem.

Here are some screen shots of more errors that have come up when I have re-tried the process, the below errors come up regardless to the code having line returns or not.

Cheers,

Sean

 Re: Duik expression error in After Effectson Oct 24, 2016 at 3:52:31 pm

There's a thread here that might provide some insight: