当我单击后效中的播放按钮时,我试图让脚本播放。该脚本假设在播放时通过sliderValue(另一层)不断打开和关闭层。(所以,我希望函数SLIDERCHECKER()在视频播放/渲染时运行每一帧)。
var firstLayer = app.project.item(1).layer(1);
var secondLayer = app.project.item(1).layer(2);
var thirdLayer = app.project.item(1).layer(3);
var fourLayer = app.project.item(1).layer(4);
var sliderValue1 = secondLayer.effect(1).property(1).value;
var sliderValue2 = fourLayer.effect(1).property(1).value;
SLIDERCHECKER();
function SLIDERCHECKER(){
app.beginUndoGroup("My script action");
if (sliderValue1 > .7 && sliderValue2 < .7)
{
firstLayer.opacity.setValue(100);
thirdLayer.transform.opacity.setValue(0);
// alert("sliderValue1 is higher");
}
else if (sliderValue2 > .7 && sliderValue1 < .7)
{
thirdLayer.opacity.setValue(100);
firstLayer.opacity.setValue(0);
//alert("sliderValue2 is higher");
}
else if (sliderValue1 > .7 && sliderValue2 > .7)
{
firstLayer.transform.opacity.setValue(100);
thirdLayer.transform.opacity.setValue(0);
//alert("both are equal");
}
app.endUndoGroup();
}