Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Controlloing a camera with markers

  • Controlloing a camera with markers

    Posted by Jose Sancho on March 4, 2009 at 10:24 am
    //Abbreviation for last layer
    m = thisComp.layer(thisComp.numLayers).marker;
    
    //Variables for time
    t0 = m.key("0").time;
    t1 = m.key("1").time;
    t2 = m.key("2").time;
    t3 = m.key("3").time;
    
    //Positions
    p0=[360,288,-833] //Initial position
    p1=[75,288,-641] //First position
    p1_2=[75,288,-501] // First subposition, to mantain camera on move
    p2=[340,400,-641]
    p2_2=[360,308,-550]
    p3=[653,288,-641]
    p3_2=[653,288,-500]
    
    //Conditionals
    if (time <= t0)
    {linear (time , 0 , t0 , p0 , p1 )  } 
    else 
    {
    if ((time >t0) && (time <= t1-0.2))
    { linear (time , t0 , t1-0.2 , p1 , p1_2 )  } 
    else {
    if ((time >t1-0.2) && (time <= t1+0.2))
    { linear (time , t1-0.2 , t1+0.2 , p1_2 , p2 )  }
    else {
    if ((time >t1+0.2) && (time <= t2-0.2))
    { linear (time , t1+0.2 , t2-0.2 , p2 , p2_2 )  }
    else {
    if ((time >t2-0.2) && (time <= t2+0.2))
    { linear (time , t2-0.2 , t2+0.2 , p2_2 , p3 )  }
    else {
    { linear (time , t2+0.2 , t3, p3 , p3_2 )  }
    }
    }
    } 
    }
    }
    
    

    Hi, I have four markers in my last layer that set time for camera´s position. I made it with conditionals but I want to know if there is a smarter solution.

    Thank you!

    Jose Sancho replied 17 years, 5 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy