Scripting Bug - Duplicating layers with layer controls
I'm using a script I sell to make a grid of layers. For some reason, if there's an expression on the layer that I'm duplicating that points to a layer control on the layer or on another layer, it locks up After Effects completely. I can replicate the issue at will.
I assume it's because After Effects doesn't know how to reference the expression as it copies? If I disable the expression, it works.

-
Joe Clay commented
Hi John! Maybe it's the combo with sampleImage?
L = thisComp.layer("Controller").effect("Layer Control")("Layer");
L.sampleImage(position,[5,5],true);Thanks for getting back to me. Sorry for the delay on my end!
-
Hi Joe,
Thank you for filing this report. What is the expression on the layer which causes AE to lock up when you duplicate it? I'm not able to reproduce the issue in either the JS expression engine or legacy ExtendScript engine with a simple property reference to a Layer Control, so something about the expression itself is likely a component.
Thanks very much for any additional information,
- John, After Effects Engineering Team