Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Darren Hardaway on April 7, 2009 at 6:03 am

    Hey guys, I was wondering if anyone has an idea on how to make this whole expression work. I have a solid that is a sphere, and it’s precomped. The main comp has the “ball” comp and a null object with a stack of SliderControls named
    A
    B
    C
    X
    Y
    Z
    The expression is applied to transform.position of the precomped “ball”

    A=(“Null 1”).effect(“A”)(“Slider”);
    B=(“Null 1”).effect(“B”)(“Slider”);
    C=(“Null 1”).effect(“C”)(“Slider”);
    X=(time-1)*(“Null 1”).effect(“X”)(“Slider”);
    Y=Math.sin(time)*100+200;
    Z=Math.sin(A*time-B)*C;
    [X,Y,Z];

    I kinda messed with values, and i got something on my graphing calculator I liked when
    A=6.8
    B=5
    C=300

    The problem is even if the ball is 3D and the comp is 3D, or the ball layer isn’t 3D and the ball comp is 3D, it will not affect the Z position of the comp. I tried adding [0],[1],[2] to x,y,z respectively but this creates an index calling error. I’m looking for a ball that bounces in a cool randomness in y and z space, while scrubbing x at the rate defined above. X and Y will work if I don’t add the dimension [0],[1],[2] to x y and z, but I really want to work with the bouncing in depth. Any help would be fantastic, thanks!

    Darren Hardaway replied 17 years, 1 month ago 3 Members · 4 Replies
  • 4 Replies
  • Eric Sanderson

    April 7, 2009 at 6:59 pm

    Do you have your collapse transformations button on your pre-comped ball turned on in your main comp?

  • Filip Vandueren

    April 8, 2009 at 12:27 am

    Is the value of Z actually always 0 if you check it in the timeline, or in the graph editor (enable the expression graph) ?
    Or does it just ‘look’ flat.
    All I can think of is that maybe the camera is not set up correctly, or your seeing the ‘front’ viewx instead of the camera view.

  • Darren Hardaway

    April 8, 2009 at 9:03 pm

    I’m not using a 3D camera, I didn’t think I needed it because I can get 3D depth with keyframes without it. I thought maybe splicing up the expression and…collapsing? the position, if that means making x y and z separate parameters to animate. I haven’t really worked a whole lot with expressions, I’m kind of converting math problems from my book and assigning dynamic variables to it. I started with a vertex formula to make a parabola A(time+-B)^2+C but it freaked with time being squared, so I used Math.sin instead. But, I’ll try with a 3D cam, and collapsing? the position parameter would be nice for clutter, and could make it more dynamic I think. Thanks for any help!

  • Darren Hardaway

    April 8, 2009 at 9:40 pm

    Alright, I kinda right clicked on position (duh) and checked separate dimesions, made a null with sliders for X Y and Z, then spliced it up and made nifty movement for all parameters. Here it is

    PositionX
    amount=thisComp.layer(“X”).effect(“Amount”)(“Slider”);
    time*amount

    PositionY
    timeToStop=thisComp.layer(“Y”).effect(“timeToStop”)(“Slider”);
    CTRL=thisComp.layer(“Y”).effect(“CTRL”)(“Slider”);
    A=thisComp.layer(“Y”).effect(“A”)(“Slider”);
    B=thisComp.layer(“Y”).effect(“B”)(“Slider”);
    C=thisComp.layer(“Y”).effect(“C”)(“Slider”);
    if(time

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