Page 1 of 1

Is it possible to do a global source-replace on a comp?

Posted: October 10th, 2007, 6:42 am
by Aaron Cobb
I'm looking to do the equivalent of an option-drag of one comp onto another in the project window. Is there such a method for a CompItem?

I'll write my own function if necessary, of course, but I really don't want to reinvent the wheel.

Re: Is it possible to do a global source-replace on a comp?

Posted: October 10th, 2007, 9:48 pm
by redefinery
Aaron Cobb wrote:I'm looking to do the equivalent of an option-drag of one comp onto another in the project window. Is there such a method for a CompItem?
hi aaron,

there's nothing built-in to do that, so you'll need to roll your own. if you have CS3, you can use the new AVLayer replaceSource() method to redirect to the new comp that you want to use.

:jeff

Re: Is it possible to do a global source-replace on a comp?

Posted: October 11th, 2007, 6:29 am
by Aaron Cobb
redefinery wrote:
Aaron Cobb wrote:I'm looking to do the equivalent of an option-drag of one comp onto another in the project window. Is there such a method for a CompItem?
hi aaron,

there's nothing built-in to do that, so you'll need to roll your own. if you have CS3, you can use the new AVLayer replaceSource() method to redirect to the new comp that you want to use.

:jeff
Thanks for confirming this.

Re: Is it possible to do a global source-replace on a comp?

Posted: August 26th, 2010, 1:03 pm
by cob906
I've tried to use the replaceSource() method of a layer and it doesn't work. I've got CS3 on a Mac Pro.

I couldn't even find the replaceSource() method in the scripting guide.

I've known that you can alt drag an item on a layer and replace that layer's source; I didn't know that you could alt drag an item in the project window on top of another item in the project window and it will do a global replace. This is handy but I'd prefer it'd be automated.

Does the replaceSource work on your end?

Re: Is it possible to do a global source-replace on a comp?

Posted: August 26th, 2010, 6:11 pm
by Aaron Cobb
cob906 wrote:I've tried to use the replaceSource() method of a layer and it doesn't work. I've got CS3 on a Mac Pro.

I couldn't even find the replaceSource() method in the scripting guide.

I've known that you can alt drag an item on a layer and replace that layer's source; I didn't know that you could alt drag an item in the project window on top of another item in the project window and it will do a global replace. This is handy but I'd prefer it'd be automated.

Does the replaceSource() work on your end?
It works fine for me. replaceSource is documented on page 47 of the AE CS3 scripting guide. It is a member of the AVLayer class and takes two parameters, an AVItem (newSource) and a boolean value (fixExpressions).

Re: Is it possible to do a global source-replace on a comp?

Posted: August 26th, 2010, 8:25 pm
by cob906
Oh man! I was looking at the AE 7 scripting guide. :roll:

Thanks for responding so quickly! I guess I need more sleep :lol:

Re: Is it possible to do a global source-replace on a comp?

Posted: October 17th, 2010, 4:57 pm
by chris w
i wrote a jsx that does this perfectly for huge ae projects. it can replace anything.
http://forums.creativecow.net/readpost/50/857857