Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Kristian Tonnessen on December 8, 2010 at 3:10 am

    I made a bar graph and control the y scale with a slider control. This slider also controls the numbers counting up from 0-100. I’m trying to get the numbers to follow the scale growth of the graph bar and get an error msg scalar. The problem is that scale 0 is the bottom of the comp and position 0 is left/top. I found a solution by rotating the bar and the number, and then flipping it back in the main comp so the bar and number look ok moving together.
    I just want to do this without rotating or the multiplication. How do I make the position of the number think that 0 is actually at the bottom of the comp (when the solid is scaled to 0), and that 100 is approximately the middle of the comp (which is roughly 500 px)

    I thought this would work:

    linear(x,100,0,0,100) but got the scalar error msg.

    Thanks,

    Kris

    temp = thisComp.layer("Null 1").effect("Slider Control")("Slider");
    [temp, temp]
    y = thisComp.layer("Null 1").effect("Slider Control")("Slider")*2.6;
    x = 20;
    [ x , y ] \this works for now

    Kristian Tonnessen
    Graphic • Motion Designer
    KING 5 Television • Seattle, WA

    Tom Gomez replied 15 years, 4 months ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    December 8, 2010 at 8:29 am

    This is one way to approach it:

    temp = thisComp.layer(“Null 1”).effect(“Slider Control”)(“Slider”);
    x = 20;
    y = linear(temp,0,100,thisComp.height,thisComp.height/2);
    [x,y]

    Dan

  • Kristian Tonnessen

    December 14, 2010 at 10:39 pm

    Thank you Dan! Your expression tips here and at Motionscript.com have helped my daily workflow many times over. I appreciate you sharing information so readily!

    Kristian Tonnessen
    Graphic • Motion Designer
    KING 5 Television • Seattle, WA

  • Tom Gomez

    January 5, 2011 at 1:08 pm

    Got a similar problem that is blowing my mind!

    The simplest expression in the universe…

    Layer with a rectangle shape. I want the y position (inside the shape) to move in concert with a percentage that is being generated by a numbers effect on a different layer. The range I want for the y is 0 to -130.

    Below is my expression.

    Either I get a “no property or method named 1” message or an “out of range” message.

    I can get it to work easy with the position value of the whole layer, but I want to use that for other types of movement. HELP!

    thanks,

    Tom

    x=thisComp.layer("GRAV percentage").effect("Numbers")("Value/Offset/Random Max");
    y=(130*x/100)*(-1);
    [value[0],y[1]]

    ================================================
    YOU can help save TimeSpace. Join the Chronos Protectorate!

    https://www.95ers.com
    https://www.SpaceAceMedia.com

  • Dan Ebberts

    January 5, 2011 at 7:22 pm

    Try changing your last line to this:

    [value[0],y]

    Dan

  • Tom Gomez

    January 6, 2011 at 3:47 am

    Rookie mistake! 🙂

    Thanks Dan.

    ================================================
    YOU can help save TimeSpace. Join the Chronos Protectorate!

    https://www.95ers.com
    https://www.SpaceAceMedia.com

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