Hello,
I am trying to precomp the 1st layer of the comp using ExtendScript. I do something like this:
var comp = app.project.activeItem.layers.precompose([1], "new precomp", true); comp.width = newW; comp.height = newH; for(var i = 1; i<= comp.numLayers; ++i) { comp.layer(i).position.setValue([newW / 2, newH / 2]); // center the layers w.r.t to new comp. }
When I issue this script through the ExtendedScript Toolkit, it goes well. However, when I execute the script programatically in C++ using ExecuteScript(), the precomp is created but AE crashes with the following msg:
AfterFXLib`___lldb_unnamed_symbol1$$AfterFXLib: Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
The script is executed when the user clicks on a button, so during the PF_Cmd_USER_CHANGED_PARAM call, could that be the issue ?
I commented out the centering code (lines 6-9) but the crash still occurs.
thx !