Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Shape layer Rectangle path time duration and size control by slider

  • Shape layer Rectangle path time duration and size control by slider

    Posted by Arun Chaudhary on July 26, 2017 at 11:24 am

    Hi all

    How to Shape layer Rectangle path time duration and size control by the sliders
    I’m using two sliders 1 for time duration and 1 for Percentage Value
    I use this expression but it is not work as we want
    m = thisComp.layer(“Animation Duration”).effect(“Animation Duration”)(“ADBE Slider Control-0001”);
    h = thisComp.layer(“Values”).effect(“Percent Value”)(“ADBE Slider Control-0001”);
    linear(m,0,100,[0,150],[h,150])

    The main problem is Shape layer Rectangle size is x=1800, y150 so y is fixed but “x” control by slider
    slider value is 0 X value 0, slider value 100 x value 1800
    I attached a screen shot for better understand

    Thank you

    Andrei Popa replied 8 years, 9 months ago 2 Members · 3 Replies
  • 3 Replies
  • Andrei Popa

    July 27, 2017 at 10:17 am

    try this
    m = thisComp.layer("Animation Duration").effect("Animation Duration")("ADBE Slider Control-0001");
    h = thisComp.layer("Values").effect("Percent Value")("ADBE Slider Control-0001")*18;
    linear(time,0,m,[0,150],[h,150])

    Andrei

  • Arun Chaudhary

    July 28, 2017 at 6:28 am

    Hi Andrei Popa than you for reply but
    unfortunately, this does not work for me I attached ae file for better understud
    Thia is a Progress Bar so count 0 to 100 by slider you can see ae file than clear all think

    https://www.dropbox.com/s/t6oqe6hmruus1io/Progress%20Bar.aep?dl=0

    Thanks

  • Andrei Popa

    July 28, 2017 at 2:46 pm

    I don’t quite understand what you want to do, but i see this as potential problems:
    If you want your pink rectangle to grow with the keyframes, use this expression on the size of the rectangle
    m=thisComp.layer("Animation Duration").effect("Animation Duration main bar")("Slider")
    linear(m,0,100,[0,150],[1800,150])

    If you want the text to grow as the rectangle grows, use this expression on the text source
    Math.floor(thisComp.layer("Animation Duration").effect("Animation Duration main bar")("Slider"))+"%"
    Maybe change the color so the bar si different.
    If you want the text to grow with the first bar, use this expression on the source text
    Math.floor(thisComp.layer("Animation Duration").effect("Animation Duration BG CR")("Slider"))+"%"
    Now, if you decide to stop the rectangle an some percent, both the text and the rectangle will act accordingly.
    Otherwise, you will have to explain better your problem.
    All the best

    Andrei

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