Global quality switch to Draft?

What type of scripts do you need?

Moderator: byronnash

Post Reply
Navstar
Posts: 68
Joined: February 16th, 2009, 12:41 pm

Is there a script to globally control the quality switch of all layers in all (selected) comps?

I'm dying with a 4K project and would like to turn everything to Draft quality while I'm assembling layers together (without having to open every comp and flick all the switches)
Screen Shot 2015-03-17 at 5.49.05 PM.png
Screen Shot 2015-03-17 at 5.49.05 PM.png (12.13 KiB) Viewed 14962 times
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

I think this will work:

Code: Select all

var myComps = app.project.selection;
var myComp;
for (var i = 0; i < myComps.length; i++){
	myComp = myComps[i];
	if (! (myComp instanceof CompItem)) continue;
	for (var j = 1; j <= myComp.numLayers; j++){
		try{
			myComp.layer(j).quality = LayerQuality.DRAFT;
		}catch(err){
		}
	}
}
Dan
Navstar
Posts: 68
Joined: February 16th, 2009, 12:41 pm

Thanks Dan! Top notch!
Navstar
Posts: 68
Joined: February 16th, 2009, 12:41 pm

Would it be a big deal to add code for it to work on nested comps too?
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

That's a little trickier, but I think this works:

Code: Select all

var myComps = app.project.selection;
var myComp;
for (var i = 0; i < myComps.length; i++){
  myComp = myComps[i];
  if (myComp instanceof CompItem){
    setLayers(myComp);
  }
}

function setLayers(theComp){
   for (var i = 1; i <= theComp.numLayers; i++){
      try{
         theComp.layer(i).quality = LayerQuality.DRAFT;
      }catch(err){
        continue;
      }
      if (theComp.layer(i).source instanceof CompItem){
        setLayers(theComp.layer(i).source);
      }
   }
}

Dan
Post Reply