Easy way to change duration/framerate to a comp and all contents
Is there any easy way to change the duration/framerate of a comp and all its contents?
Example
I've made a comp (A) that is 30 seconds long 30fps since making that I've made a new comp (B) that is 5 seconds 60fps now the default is this. If I then import a file.
newFile.importAs = ImportAsType.COMP_CROPPED_LAYERS;
newLayer = app.project.importFile(newFile);into my comp A it will take the settings from comp B.
What I've tried
In my script I made a throwaway comp that copies the settings from the comp I'm importing to
app.project.items.addComp(mainCompName, mainCompWidth, mainCompHeight, 1, mainCompDuration, mainCompFrameRate);in hope that it would then change the comp settings defaults for when I import the file. It does not.
Another thing I've tried is manually setting the comps duration and then for loop through all the layers to change the outpoints however if there is another comp in this comp I will have to have nesting loops which is fine but I wanted to know if there's an easier way before I write this loop.
newLayer.duration = mainCompDuration;
newLayer.frameRate = mainCompFrameRate;
for(i = 1; i <= newLayer.layers.length; i++){
newLayer.layers[i].outPoint = mainCompDuration;
}Thank you for any help.
