Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression Oddity – not reading keyframes across compositions.

  • Expression Oddity – not reading keyframes across compositions.

    Posted by Jamie Bradshaw on January 19, 2011 at 11:33 am

    Hi all.

    I will try my best to explain my problem.

    In one composition I have a layer with some Slider Controls. In another composition I have some expressions that refer to these Slider Controls. It all works fine until I actually add keyframes to the animate the Slider Control values. It appears that it is ignoring the keyframe data and just takes the value assigned to to first keyframe. What is odd about this is that the same setup is working fine in other compositions in the same project and I am struggling to find what is unique about this one that is causing problems.

    I appreciate that this is hard to understand without seeing the project, but I was just wondering if anyone else has encountered a similar problem and might some indications as to what the problem could be.

    Many thanks,
    Jamie

    JimJam•Graphics
    https://www.jimjamgraphics.com/

    Dan Ebberts replied 12 years, 6 months ago 6 Members · 8 Replies
  • 8 Replies
  • Jamie Bradshaw

    January 19, 2011 at 11:36 am

    Oops forgot to mention that I am using CS5 10.0.0.458 if that is any help.

    JimJam•Graphics
    https://www.jimjamgraphics.com/

  • Ben Rollason

    January 19, 2011 at 9:34 pm

    You’ve probably time offset the layer in the top comp.

    try:

    L = comp(“top comp”).layer(“layer whatever”); //the layer with this comp as source
    T = time + L.startTime;
    this.position = L.position.valueAtTime(T);

    -Ben.

    vfx.benrollason.com

  • Todd Kopriva

    January 20, 2011 at 7:36 am

    > I am using CS5 10.0.0.458

    I strongly recommend installing the After Effects CS5 (10.0.1) update. That update fixes a lot of problems.

    ———————————————————————————————————
    Todd Kopriva, Adobe Systems Incorporated
    Technical Support for professional video software
    After Effects Help & Support
    Premiere Pro Help & Support
    ———————————————————————————————————

  • Jan Sickinger

    March 12, 2011 at 11:53 am

    i had the same problem. the answer was the time-problem.

    https://forums.creativecow.net/thread/227/17733#17738

    going to try ben´s solution.

    thanks everyone, jan

  • John Cooper

    October 28, 2013 at 8:18 pm

    I am having a similar problem and after reading through this thread, I don’t fully understand what’s going on.

    main_comp contains:
    scene_comp contains:
    object_comp contains:
    object_layer

    object_layer opacity is set with the following expression:
    comp(“main_comp”).layer(“Audio Amplitude”)(“Slider”)

    I can confirm that this expression works by watching the value of opacity of object_layer as I scrub across the main_comp’s timeline where the audio amplitude changes (after time 1;00;00).

    Problem: When I place the scene_comp at time 1;00;00 (where the audio amplitude values actually change), the opacity fails to change as expected given the values of the audio amplitude Slider.

    Test 1 Succeeds: Placing the scene_comp at time 0 of main_comp and sliding the audio amplitude layer such that the audio amplitude value starts/changes, changes the opacity of of the object_layer as expected.

    Test 2 Succeeds: Placing the scene_comp anywhere along the timeline of main_comp and then sliding the audio amplitude layer to the left again until the audio amplitude changes, changes the opacity of object_layer as expected.

    Test 3 Fails: Placing the scene_comp anywhere along the timeline of main_comp where the audio amplitude is changing while leaving the audio amplitude layer static fails to change the opacity of the object_layer. This is what I would like to do.

    Question A: What is my problem?
    Question B: How do I fix it?
    Question C: How do I prevent this from occurring in the future?

    TIA

    comp("main_comp").layer("Audio Amplitude")("Slider")

  • Dan Ebberts

    October 28, 2013 at 11:20 pm

    If it’s only the scene comp that’s offset from time zero, I think this will work (not tested–may be typos):

    C = comp(“main comp”);
    ctrl = C.layer(“Audio Amplitude”)(“Slider”);
    ctrl.valueAtTime(time + C.layer(“scene_comp”).startTime)

    If other elements are also offset, the valueAtTime() calculation would need to be adjusted accordingly.

    Dan

  • John Cooper

    October 29, 2013 at 8:51 am

    Thanks Dan. Worked like a charm. Are the following answers correct, below?

    Question A: What is wrong?
    Answer: The object layer expression always reads at t=0 of the control source layer.

    Question B: How do I fix it?
    Answer: Start the object_layers expression at main_comp.time + scene_comp.startTime

    Question C: How do I prevent it?
    Answer: You can’t prevent it unless all of the comps have exactly the same duration.

  • Dan Ebberts

    October 29, 2013 at 2:36 pm

    Answer A: The expression is asking for the value of the slider at the current time of the comp with the expression. If anything in the stack of nested comps between the expression and the slider has been offset in time, that time won’t be correct in the slider comp. Think of it like time zones. If I want to call you at 3PM your time, I need to compensate for any difference in time zones.

    Answer B: You have to compensate for any time offsets in the nested comp stack.

    Answer C: It’s not the duration that matters, it’s the relative start times. If everything starts at time = 0 (same time zones), no problem.

    Dan

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