Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

361
Visualizações
How do I make this code begin when its playing in after effects? (javascript)

I am trying to make the script play when I click the play button in after effects. The script is suppose to constantly turn on and off layers by sliderValue(of another layer) while playing. (So, I want the function SLIDERCHECKER() to run every frame while the video is playing/rendering).

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();
  
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda