ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Strange Issue with Expression Control Effects and Precomp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Scott Bush
Strange Issue with Expression Control Effects and Precomp
on Oct 30, 2009 at 3:11:24 pm

Been having a strange problem that seems to have only popped up recently... using both a brand new and an old (from CS3) project in CS4 (9.0.2).

Please bear with me as I'm having somewhat of a difficult time trying to explain this...

When I use an expression control effect to link to a property in a precomp, everything works fine until I set a keyframe and try to animate the expression control.

For example, I am creating a planet earth using CC Sphere (original I know). The earth image is 2 layers in a precomp (so I can control the opacity of the water and land sections separately). I apply the CC Sphere to the precomp, and everything is fine so far. I now have my "globe comp" set up to use in my main render comp. What I'm trying to do is control the Y Rotation of the CC Sphere effect in my main render comp, so I set up an Angle Control effect and link it to the Y Rotation of the CC Sphere effect (in the globe precomp). This works perfectly fine - I can rotate the globe from my main comp... UNTIL I set a keyframe. Once I try to animate, the Angle Control stops working and the globe will not rotate. Delete the keyframes and it works again.

I had the same issue with another project (which is too complicated to explain here) - it's a project I use somewhat often that has several precomps so I can swap out the source images. I created it back in CS3 and it always worked fine - until a few weeks ago. Suddenly the expression control effects stopped working - but only if I set keyframes. Without the keyframes they still work (so it isn't a naming issue). This project has worked for me sevral times in the past, but the last time I tried it all my controls were not working. I though it was just a weird glitch until my globe project mentioned above proved otherwise.

I am on a brand new installation of OS X 10.5.8 with AE CS4 9.0.2 (also a fresh install). No preferences or anything were brought over from my old system. I have tried purging the ram, rebooting, another system even - and same issue all around. Of course I can use a workaround and animate in the precomps, but the expression controls would make it so much easier - if only they were working properly.

Am I missing something here and trying to do the impossible? or is there something wrong here?

Thanks!
Scott


Return to posts index

Xinlai Ni
Re: Strange Issue with Expression Control Effects and Precomp
on Oct 30, 2009 at 5:02:13 pm

By "not working", did you mean that after you add a key frame of the slider control, sliding it won't affect the rotation of the earth as it used to when it doesn't have the key frame?
Then this must have been because the actual value out of this slider control is overridden by the key frame. It makes sense - when you use key frames, you want its value to be controlled by the key frame, not what you manually told it to be. So the earth doesn't rotate because you only have one key frames -- one key frame means constant value throughout the time. Have you tried using two key frames at the beginning and end of the time? You should be able to see the earth rotating between the angles specified by those key frames.

Xinlai Ni
Software Engineer, Google Inc.


Return to posts index

Scott Bush
Re: Strange Issue with Expression Control Effects and Precomp
on Oct 30, 2009 at 5:09:15 pm

Thanks for the reply, but yes - ANY keyframes "break" the rotation.

The CC Sphere effect is in a precomp, with no keyframes. The Angle Control effect is in the main comp. I tie the Y Rotation of the Sphere effect to the Angle Control with a simple expression. When I manually drag the slider control with no keyframes set, the rotation works in the comp viewer. But as soon as i try to animate it with keyframes, it stops responding. The keyframes don't work, manually sliding doesn't work - it just breaks.

In my old project, I already had keyframes set for the angle control, and they used to work perfectly (I have old renders to prove it) but when I import the project now, the keyframes are still there, the expression is still linked properly, but nothing happens.



Return to posts index


Xinlai Ni
Re: Strange Issue with Expression Control Effects and Precomp
on Oct 30, 2009 at 5:15:36 pm

How did you refer to the value of the slider in your globe comp?
Did you use valueAtTime?

Xinlai Ni
Software Engineer, Google Inc.


Return to posts index

Scott Bush
Re: Strange Issue with Expression Control Effects and Precomp
on Oct 30, 2009 at 5:24:27 pm

I pickwhiped the Y Rotation value of the CC Sphere to the Angle Control effect. I'd paste the code in but I have already used my workaround and cannot mess with it right now. But it is a very simple tie one value to another (and since it is an angle control tied to a rotation control there should be no need to convert the values).

The expression works... as long as I don't try to animate the angle control. When I slide the control in the effects controls window the globe rotates in my comp view... until I add a keyframe (or several keyframes) -- then it won't even move when I manually slide.




Return to posts index

Xinlai Ni
Re: Strange Issue with Expression Control Effects and Precomp
on Oct 30, 2009 at 5:34:41 pm

Just out of curiosity, what you've described worked for me perfectly, and I am using the following expression for the globe precomp's CC-sphere layer's yRotation property:
comp("Main").layer("Control").effect("Angle Control")(1)

and it works both with my manual dragging the angle control or with key frames.


Xinlai Ni
Software Engineer, Google Inc.


Return to posts index


Scott Bush
Re: Strange Issue with Expression Control Effects and Precomp
on Oct 30, 2009 at 5:49:19 pm

Thanks very much for your time on this...

Here's what weird (and frustrating!!!) -- I just rebuilt the thing to test, and of course, now that I'm asking for help, it works as it should!

The expression is the same one I'm using.

There's got to be SOMETHING going on in my other projects - but the fact that the old one was suddenly broken is what throws me off. I guess I'll just keep pluggin away and if I see this again I'll give an update... but for the moment I'm completely baffled.

Are there any gotchas for this sort of thing? Maybe something specific I should look for in my 'broken' stuff?

Thanks again,
Scott



Return to posts index

Bert Brown
Re: Strange Issue with Expression Control Effects and Precomp
on Nov 4, 2009 at 2:27:24 pm

Just so Scott doesn't seem like a crazy person, I've had the same issue.


Return to posts index

Scott Bush
Re: Strange Issue with Expression Control Effects and Precomp
on Nov 4, 2009 at 2:39:50 pm

Bert!!! Thanks! I was starting to wonder about my sanity ;)

Did you ever figure this out? Does it ever "go away" or once it happens to a project does it stick? As I'm sure you saw when I rebuilt the globe project from scratch it was just fine, but the original project still doesn't work properly. It's really strange! I simply can't seem to find any sort of pattern - I've examined everything and it SHOULD work...





Return to posts index


davide zetti
Re: Strange Issue with Expression Control Effects and Precomp
on Mar 29, 2010 at 11:36:29 am

have you solved this problem?
I have your same issue with Expression control effects but i'm on windows


Return to posts index

Jeffrey LeJune
Re: Strange Issue with Expression Control Effects and Precomp
on Apr 15, 2012 at 2:45:28 am

Hate to drag something up from the past but I ran into this issue tonight and found this post which describes my issue almost exactly. I spent hours setting up a rig that would be controlled by the expression controls in the main comp. I can see the items in the precomp move when I scrub the sliders but as soon as I key frame nothing happens. Wonder if you ever got down to the bottom of what was going wrong.

Thanks


Return to posts index

Dan Ebberts
Re: Strange Issue with Expression Control Effects and Precomp
on Apr 15, 2012 at 6:08:30 pm

This can happen if your precomp layer starts at some time other than zero in the main comp. You may need to add an offset equal to the start time of the precomp layer, like this:

offset = comp("main comp").layer(thisComp.name).startTime;
comp("main comp").layer("controls").effect("Angle Control")("Angle").valueAtTime(time + offset);

Dan



Return to posts index


Jeffrey LeJune
Re: Strange Issue with Expression Control Effects and Precomp
on Apr 15, 2012 at 6:15:42 pm

Thanks for taking the time to address this Dan. I will give it a try and let you know.


Return to posts index

Thanassis Pozanztis
Re: Strange Issue with Expression Control Effects and Precomp
on May 16, 2012 at 10:48:59 am

Thanks Dan,
your solution did indeed solve the problem.

Thank you so much!
T


Return to posts index

Grim Roper
Re: Strange Issue with Expression Control Effects and Precomp
on Sep 18, 2012 at 12:34:21 am

Hi

I'm having a similar issue:

I have a main composition containing my control layer and a pre-comp which is Time Remapped. This pre-comp contains 4 more pre-comps that are sequenced (which each contain a different version of the object that I want to animate. I have a slider in the main comp which controls which version is in view).

I have sliders in the main comp controlling the properties I want to animate (these properties are "two comps deep," if you will), and they all work perfectly until I try to set a keyframe.

I'm guessing the problem has something to do with the Time Remapped precomp that is "in-between" the controllers and the object, and I'm wondering if there is any way to make it work.

Any help or suggestions would be appreciated,

Regards


Return to posts index


Alex Ramirez
Re: Strange Issue with Expression Control Effects and Precomp
on Feb 22, 2013 at 1:25:14 am

Hey I was having the same problem but i think i found some kind of solution for me.
The thing is that I was using my expression in a 4 frame long comp with time remap then my main comp was 3 min long and it was also in time remap I remove this time remap and make every comp 4 min long.

If any one needs a more detail explanation pls contact me or reply something in here.

thx


Return to posts index

Scott Bush
Re: Strange Issue with Expression Control Effects and Precomp
on Feb 22, 2013 at 2:47:10 am

I love that this thread comes to life every couple months or so (or years sometimes). And that Dan Ebberts helped out! A few of the tips in here come in handy to this day so thanks all for helping!



Return to posts index

james lashmar
Re: Strange Issue with Expression Control Effects and Precomp
on Mar 6, 2014 at 1:42:35 pm

This can happen if your precomp layer starts at some time other than zero in the main comp. You may need to add an offset equal to the start time of the precomp layer, like this:

offset = comp("main comp").layer(thisComp.name).startTime;
comp("main comp").layer("controls").effect("Angle Control")("Angle").valueAtTime(time + offset);

Dan

++++++++++


This solved my problem but then I ran into another in reverse but can't figure it out...

So i have a shape layer with an animated position copied and pasted from a path. This is preComped and looped forever. This preComp is also preComped again within a master comp.

I want to take the position of the original shape layer and apply it to a null (that is in the master) so that is at the current position that the shape layer is at the current time within the master comp.

How can i do this please?


Return to posts index


james lashmar
Re: Strange Issue with Expression Control Effects and Precomp
on Mar 12, 2014 at 11:41:49 am

Here's a sample of what i'm trying to achieve. Ae is CS6.

I would just like to apply the shape layers position to the corresponding nulls in the master comp.

http://www.mediafire.com/download/1fox5vex3jz2fyz/preComp_layerPos.aep


Return to posts index

Kris Hernandez
Re: Strange Issue with Expression Control Effects and Precomp
on Jul 14, 2016 at 11:16:44 pm

Hey!

Having the same exact issue, but I have a rookie question here!...where do I plug in the time code?

offset = comp("main comp").layer(thisComp.name).startTime;
comp("main comp").layer("controls").effect("Angle Control")("Angle").valueAtTime(time + offset);

Thankful for any help that you might be able to give,

Kris


Return to posts index

Dan Ebberts
Re: Strange Issue with Expression Control Effects and Precomp
on Jul 15, 2016 at 1:21:27 am

You would use it for the expression in the precomp that refers to the angle control in the main comp.

Dan



Return to posts index

Marcel Izumi
Re: Strange Issue with Expression Control Effects and Precomp
on Jul 2, 2018 at 4:51:36 am

I know this is old, but in the middle of 2018 I have struggled with pretty much the same issue:

- A slider Expression Control was rigged to control the time remapping value of a sub-comp, a couple levels down (in other words, a sub sub sub comp).
- The symptom was that when I tested the sliders, they all worked, but as soon as I started keyframing them, they stopped working, i.e. further adjustments to the slider didn't appear to do anything at all.

I noticed after a while that what really happened is that as soon as there was a single keyframe on the slider, the frame shown of the subcomp in question was stuck to that of the first keyframe. So if subcomp D would show a 7 on frame 7, setting the first keyframe on the slider in main comp A at the value of 7 would get the subcomp D stuck displaying a 7, regardless of further slider adjustments. You can test this by swapping out the first two keyframes.
I read comments pointing toward the method valueAtFrame(), but I was unable to access the time variable of the main comp from sub comp D. But hard coding it to a different frame prove that the sub comp constantly reads a 0 from the main time variable.

What solved the problem for me was the realization that ALL COMPS BETWEEN THE MAIN COMP AND THE SUB COMP IN QUESTION MUST HAVE A SUFFICIENT FRAME RANGE / LENGTH TO ACCOMODATE THE LENGTH OF THE ANIMATION. So if the Main comp is a parent of comp B, which is a parent of comp C, which is a parent of comp D, which has time remapping enabled and rigged to a slider in the main comp, and your animation in the main comp is 500 frames long, comps B and C MUST ALSO be at least 500 frames long regardless of if you have anything going on in them or not. My mistake was that since I wasn't planning on animating in those comps, comps B and C could be single frame comps. That's not the case.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]