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

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Aaron Cobb
Posts: 10
Joined: September 10th, 2007, 12:22 pm

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.
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

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
Aaron Cobb
Posts: 10
Joined: September 10th, 2007, 12:22 pm

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.
cob906
Posts: 28
Joined: August 8th, 2006, 3:25 pm
Location: Lewisville, TX
Contact:

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?
Aaron Cobb
Posts: 10
Joined: September 10th, 2007, 12:22 pm

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).
cob906
Posts: 28
Joined: August 8th, 2006, 3:25 pm
Location: Lewisville, TX
Contact:

Oh man! I was looking at the AE 7 scripting guide. :roll:

Thanks for responding so quickly! I guess I need more sleep :lol:
chris w
Posts: 13
Joined: October 13th, 2010, 5:16 pm

i wrote a jsx that does this perfectly for huge ae projects. it can replace anything.
http://forums.creativecow.net/readpost/50/857857
Post Reply