Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using Expressions with an Image Sequence

  • Using Expressions with an Image Sequence

    Posted by Alex Mann on March 24, 2011 at 5:16 pm

    Hi guys,

    I’ve only just begun tangling with expressions after watching Andrew Kramer’s super (let’s face it they’re all super!) tutorial on Video Copilot (69. 3D Offset) in which he deals with using expressions to offset the timing of a single animation in duplicate identical compositions. I have a grounding in Actionscript for Flash which kind of gives me hope, although I’m already struggling with basic AE syntax and generally what is possible.

    Here’s my problem/query. I want to effect something like Andrew shows in his tutorial, namely animating multiple instances of the same composition, and offsetting their animations by x amount of seconds etc. However, unlike in Andrew’s tutorial where the object/image inside the composition is the same, I am using a sequence of 33 images which all reside multiple instances of the same composition (MainComp).
    To enable MainComp to display each different image within with multiple fuss, I set the MainComp’s FPS to 1FPS duplicated the layer it sits on 33 times, stuck a time remap on them and the simple expression time=index-1 (-1 to account for the image lying in MainComp between 0.00 and 1.00). It worked and I had a big grin on my face.

    Now I’m kind of in a quandary, because I also want to animate each instance of MainComp only once and set the offset of each using some of Andrew’s expression methods that he shows in the tutorial. However, I feel like I’ve had my ‘one shot’ by using a time remap/expression to display each image ‘dynamically’. I can’t animate inside MainComp, because the expression on each instanced layer in the parent comp will override it. I can’t animate outside the parent Comp of MainComp because my expression will then be ignored.

    By explaining all this (and hopefully not confusing anyone who reads it) I’m leading up to the question: is it possible to have an expression within MainComp or within yet another child-composition of MainComp similar to time=index-1, but evoking the index (layer) number of the PARENT comp in which that instance of MainComp sits? Or even the parent of the parent. Something like time=parent.parent.index-1? Does that make sense, or have I convoluted the whole business?

    Any help/tips or links to relevant tutorials are appreciated (I have checked for tuts btw, but couldn’t any)

    Thanks in advance

    Alex Mann replied 15 years, 4 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    March 24, 2011 at 5:24 pm

    You can only access a comp by name, so there’s no way to get there by parentage. In some cases you can get around this if the name of the parent can be deduced from the name of the child like this:

    myParentComp = comp(“main_” + thisComp.name);

    Dan

  • Alex Mann

    March 24, 2011 at 5:34 pm

    Wow, thanks for the quick reply, Dan. Ok, I think I understand that alright. Is it possible then to find out what layer number of the parent(multiple parents even) composition the particular instance of MainComp from within MainComp itself by accessing it using the comp name. So if you had two instances of MainComp sitting in a structure like this…

    ParentComp[layer1] .ChildComp.MainComp
    ParentComp[layer2] .ChildComp.MainComp

    … you could have an expression in MainComp saying time=comp(“ParentComp”).index-1 or something?

  • Dan Ebberts

    March 24, 2011 at 6:45 pm

    If you know the name of the parent comp, you can find the expression comp’s layer index in the parent comp like this:

    myIndex = comp(“parent comp”).layer(thisComp.name).index;

    However, if there are multiple layers with that same name, all references will go to the first one.

    Dan

  • Alex Mann

    March 24, 2011 at 7:24 pm

    Thanks again, Dan.

    I don’t think this is going to work for me on account of the fact that thisComp.name is always going to be the same in this particular instance and if it is on a layer that is named something different the alert box throws up an error that it can’t find a layer matching thisComp.name. And, like you say, if there are multiple layers sharing the same name etc….

    So in a bit of a catch 22. Will have to look for another corner cutting solution. Cheers for the very prompt help though, at least I’ve learned something new today 🙂

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