FORUMS: list search recent posts

Stop code running, until precomp isn't ready

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gerg Tolcs
Stop code running, until precomp isn't ready
on Sep 22, 2015 at 11:25:19 am

Hi, my problem is this: I'm writing a script. in a for cycle, it generates 6 layers, pre-comp them, generate 6 (similar) layers, pre-comp them, etc, everything is ok. But, I want 2 layers (not all the 6) to pre-comp, before pre-comp the 6 layers, and want to do some stuff with layers, and the pre-comped 2 before the 'bigger' pre-comping. The problem is - as I see - that the pre-comping of the 2 is not ready, when the script want to use it, so I need something, a trick or whatever, what stops the code of the for cycle, when the AE is working on pre-comping.

I tried to make a recursive function, with the new (2 layers pre-comp) name but it isn't work - I know it's ugly, but...

I write it down, in the code section, I don't want to write the full code, it was perfect, before the 2 layers precomp stuff. Google didn't help me, thank you the answers!

var testPrecomp = function(){
if(typeof(mainComp.layers.byName('preCompTwo')) === 'object'){
//Do the job

Return to posts index

Xavier Gomez
Re: Stop code running, until precomp isn't ready
on Sep 22, 2015 at 3:29:25 pm

It's not very clear what you are trying to do and where the problem comes from.

I think that, in a script, an instruction is not executed before the previous one is not actually finished, including what it may represent inside After Effects ("precomping", rendering, whatever). What error do you have ? Any chance that you refer to objects (layers) that dont exist anymore because of the precomp operation?


Return to posts index

Gerg Tolcs
Re: Stop code running, until precomp isn't ready
on Sep 22, 2015 at 4:04:48 pm

Thank you, and sorry, I was totally wrong.

I did the pre-comp, but I made some silly (spelling) mistake, and the result was undefined later, when I wanted to work with that. I guess, the error handling of the browsers, and IDEs is too comfortable :) I'm new in AE scripting, and sometimes I think, I don't know something special and important, instead of reading again my code :/

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved