I wrote a script that copies certain layers into a new composition. It then generates expressions for the new layers properties (transform properties, puppet points and time remap) dynamically linking them to the old layers.
The script works fine and returns no errors. However after running it "After Effects" gives me the following error for some of the newly created expressions:
"After Effects warning: stack overrun
error occurred at line 0"
It will then disable those expressions. Again, just some of them. Now, the expression itself is fine because I can just go into the new composition and click on the "=" to reenable them and I get no error.
The strange thing is, though, that if I run this same script with the caps lock I don't get any error at all. (Also, strangely, at the end of the script it gives an alert to let you know how many layers were duplicated, and if I turn off this alert I don't get an error either.)
This script is for a client so I can't tell them just make sure you have your caps lock on. Does anybody know what might be causing this?
I really don't have any specific knowledge of what's going on under the hood, but my hunch is that you may have a lot of layers with expressions possibly referring to other expressions so that AE needs a lot of stack space to calculate everything. Other things going on at the same time (script, frame render, ?) may be competing for the same space, which could make it behave differently, depending on other conditions. You might want to look at your expressions to see if you can eliminate some dependencies on other expressions. Again, this is all speculation on my part.
It's strange though that running it with the caps lock on would prevent this error. Turning the caps lock off after it runs gives me no errors.
I may have fixed it however, though I don't understand why. As I said before the script makes a new composition and then adds it into the main composition. It then copies layers into this newly created composition and adds expression. The thing I changed is that I now have the script collapsing this new composition. For some reason I'm not getting the error anymore. I'm cautiously optimistic.
I should say that I'm working on cs6 which I have found to be buggy.
I believe you were right, Dan. A few expressions got the "overrun" error that were on layers no even being copied over. So I assume they were trying to recalibrate due to the new information which was overloading AE memory. I'm on an older computer. If I was using a computer with more memory would that help? Forgive me if that is a stupid question. Thanks, Julian
Sorry, one more question. The script is doing a lot of operations. Is it possible that since I have the entire operation under one undoGroup that I'm bogging AE down. And if I were to divide the operation into several undoGroups it might free up memory?