FORUMS: list search recent posts

Referencing a comp if 2 comps have the same name

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kiril Parushev
Referencing a comp if 2 comps have the same name
on Jan 17, 2014 at 12:03:18 pm

Hello.

I've been working with after effects for quite some time now but this is the first time I stumble onto something like that...

So, basically, I am making a template of sorts. For several reasons I've found it easier to break the template into several separate AEP files, so if I need anything, I would just drag and drop the file in my new project and have a brand new copy of all the nested layers inside it. Each file has a "Settings" comp, which includes only one null object, also named settings, which contains expression controls to control all the other compositions in the project.

And here comes the problem. When I add the aep file twice, I end up with two "settings" compositions. So, when I reference it with comp("settings").layer("settings") the two separate aep files follow the values of only one of those settings comps.

Is there any way to go around that? I, for one, found a solution but it feels like cheating :) If I import the first aep file and rename my comp to "settings 1", all expressions will update. Then I import the next one and again rename to "settings2" and so on.

The bedrock of my question:

but other than that. Is there a way to reference a SPECIFIC comp if you have 2 comps with the same name?


Return to posts index

Philip Bowser
Re: Referencing a comp if 2 comps have the same name
on Jan 17, 2014 at 8:23:14 pm

I do not believe there is any way to reference a composition other than by name. I thought at first you could maybe use indexes.. but after some searching I don't think comps have indexes in the project bin that are accessible by expressions.

If you are importing separate project files which each have settings comps, you could name their respective "settings" comps uniquely. For instance, if you were importing a project file which had a bunch of squares of different sizes you could call it "Square Settings", and then your project file which has all the clowns would be called "Clown Settings" etc. I have no clue what kind of settings you'd have to implement for the clowns in this hypothetical scenario... I hate clowns... but if that is by chance actually your situation, I'm so sorry.

However if you needed two instances of square/clown compositions, I believe your way of renaming is the way to go.

Philip. Bowser


Return to posts index

Kiril Parushev
Re: Referencing a comp if 2 comps have the same name
on Jan 19, 2014 at 9:44:17 am

You just had to mention *clowns*, didn't you. Now I can't get any work done.

Thanks, mate. I thought of the renaming thing as well, so I guess that's the thing to go around that. I hope adobe take a note here and think of that for their next releases. I know it will f*ck up the backwards compatibility but I can live with that.

Thanks and take care.


Return to posts index

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