When working with "index expression + a lot of layer duplication" you often have to change a tiny bit of code on multiple layers.
What if you could link one expression to multiple properties?
The result should be that on every single layer the same version of the code is being exectued. Changing the code of the master expression keeps the code of the child expressions in sync.
Implementations could be done via the Essential Graphics panel.
This feature would really help:
- Developers of scripts & expressions
- People who work on complex rigs
- Experiental and procedural design
Micah Haun commented
I would use this a lot. It could probably just be a new expression control effect plus a way to reference and instance it on the destination layers. Essential graphics might not be needed unless there are precomps involved.
In any case, there are a lot of things I do where the same expression goes on numerous layers. This would make that a lot easier to deal with.
Jakob Wagner commented
Using source text is a great way of optimizing the script. However, it's more a workaround than a fix.
It would be totally awesome to have a master expression which could directly control properties on other layers. I have submitted this request before. It's time for a expressions overhaul.
It would have the following advantages:
1. All above. Better easier code. No need to put expressions on every layer.
2. Much easier bug finding.
3. Faster expressions. I really think this approach would significantly speed up the execution of expressions. Since the playback wouldn't have to figure out which expressions should run first.
One other thing that have to do with performance: If you use the source text trick, will the expression be called once a frame or every time a property references it? This is unclear, but I think it's the latter. If it is for every reference, then that alone would mean a huge performance increase.
4. Persistent variables. Right now it's really difficult to code things like simulations, since a variable will be overwritten on every frame. You can't have a variable that would start at zero and then increase at a given value each frame. (not necessarily the same value each frame)
If you really that one just know that there are already several ways to achieve this:
this video give you some of those:
but the best one is this one:
but beware on the last version of AE(15.1) if you want to use a json file as shown by this you have to give it a .jsx extension
And Lars Jandel made a panel to edit JSON directly in AE (https://twitter.com/LarsJandel/status/923181788045836288) I don't know if it will work with .jsx but if you ask him nicely you will end up with something super closed from what you asked