Skip to main content
SmooBG
Participating Frequently
February 20, 2023
Answered

Script to turn all layers in multiple comps into 3d layers?

  • February 20, 2023
  • 1 reply
  • 792 views

Hey Y'all,

     I have imported multiple PSD files with many comps/layers.  I need them all to be 3D layers, but I don't want to manually go into 30 comps and change the layers to 3D by hand.  Is there a script or some quick way to do this?  Thanks!

Correct answer Dan Ebberts

Try this:

for (var i = 1; i <= app.project.numItems; i++){
	if (app.project.item(i) instanceof CompItem){
		for (var j = 1; j <= app.project.item(i).numLayers; j++){
			if (app.project.item(i).layer(j) instanceof AVLayer){
				app.project.item(i).layer(j).threeDLayer = true;
			}
		}
	}
}

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
February 20, 2023

Try this:

for (var i = 1; i <= app.project.numItems; i++){
	if (app.project.item(i) instanceof CompItem){
		for (var j = 1; j <= app.project.item(i).numLayers; j++){
			if (app.project.item(i).layer(j) instanceof AVLayer){
				app.project.item(i).layer(j).threeDLayer = true;
			}
		}
	}
}
SmooBG
SmooBGAuthor
Participating Frequently
February 20, 2023

Thanks for your reply, Dan!  I'll try it in a couple of hours when this project finishes rendering!