Can this function be done in scripting? There are two ways to do it with keyboard shortcuts or dragging. I am importing some files into a project and need to swap the new items with layers that exist in a comp.
Replace a selected layer's source footage in Composition window with selected footage:
Ctrl + Alt + /
Command + Option + /
-or-
Replace a selected layer's source footage item or composition:
Alt-drag footage item from Project window into composition
Option-drag footage item from Project window into composition
Replace footage in comp
Moderator: Paul Tuersley
The only way that I can see to do this (by way of workaround; don't ask me why source is read-only ... bizarre) is by the following:
- 1)precomp the specified layer:
newComp=layerColl.precompose([1], ("foo"), false);
//where layerColl is the activeLayer.layers, [1] is layer 1 (or whatever it's supposed to be), false keeps properties in original comp instead of nesting them
2)either set the original layer's enabled to false:
newComp.layer(1).enabled=false;
//or remove it:
newComp.layer(1).remove();
3)make a new layer collection object from the new comp (which can be empty, i.e. no layers):
newCompLayerColl=newComp.layers;
4)add the 'replacing' AV Item to newComp:
newCompLayerColl.add(otherAVItem);
//where otherAVItem is a previously specified AV Item
That's not a bad idea zold, I didn't think of precomposing it. It's not quite as clean as you would like but the end result should get you there.
With the script I was asking this question for, I ended up copying the values from a text file. I coped and pasted keyframe data to a file and then read from that file when I came to each importing each layer into a comp. It worked OK, but took a little time setting up.
With the script I was asking this question for, I ended up copying the values from a text file. I coped and pasted keyframe data to a file and then read from that file when I came to each importing each layer into a comp. It worked OK, but took a little time setting up.