Change size of video FootageItem in Layer
hi,
I'm replacing video footage in a Layer by using the following code (earlier in my code I declared 'layer'):
var targetVideo = 'pathTo/my.mov';
var myFile = File (targetVideo);
if (myFile.exists) {
var importOptions = new ImportOptions(myFile);
var theImport = app.project.importFile(importOptions);
layer.replaceSource(theImport,true);
}
This replaces the source of the layer and seems to keep property values such as scale and rotation,
which is nice. But my target video is way bigger (higher resolution) than my source video,
and I would like to size it down so it looks the same after replacement while keeping transform properties applied to the source layer.
I can't just resize the layer or the layer.source because it gives me an error:
'Can not change attribute “width” of item “myVideo.mp4” because the item is neither a comp nor a solid.'
I guess I could try to nest the layer inside a comp or solid and then change the size of the parent layer.
Would that be the way to go or is there a simpler way to deal with this?
Thanks!
Jeff.
