I have used Duik and it's a pretty elaborate script in itself. Assuming that you are putting your nulls exactly over your puppet pins, and that you are referencing the correct null in each pin position script, I would imagine that Duik script has already offset the positions of your layers so that you may think the pins and nulls are lined up -- but they are only lined up thanks to Duik.
Try turning off Duik to double check your pin/null correspondence. If you can get it to work with Duik disabled, then turn Duik back on and see if there is some constant offset you can use to use both Duik and one of the scripts above.
Or try precomposing the thing you are trying to puppet pin/null before using duik. Will Duik rig something that has pre compositions? Good luck!
Neither of your expressions will work. You need to study up on layer space transformations.
Try changing the expression:
Hey Rick. You are assuming there is an [x,y,z] I didn't make that assumption as Duik and both of the scripts mentioned work with 2d. They both work really well when not encumbered by Duik. Not sure why you you are saying that the scripts won't work.
Not assuming xyz, making it work if you switch the layer to 3D. That is all. The expression still works just fine in 2D.
I'm not saying the scripts don't work, the problem states was that the expressions didn't work when he applied them to a null. The expression, actually both expressions, are incorrectly written to link a parented layer with a layer that has or is a parent. You have to use ([0, 0, 0]) and not (anchorPoint).
Hmm. First you are saying that "Neither of your expressions will work." Then you are saying, "I'm not saying the scripts don't work". Help me to understand… are you making a distinction between a script and an expression?
FYI, he never said he was applying each to a null. The first one is written to be applied to PUPPET PINS which have no x,y,z irregardless of 2d/3d toggle (and it still works like a charm)
n=thisComp.layer("name of null")