Skip to main content
SmooBG
Participating Frequently
Feb 20, 2023 9:46 PM UTC
Answered

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

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!

Dan Ebberts
Dan EbbertsCorrect answer
Community Expert
Feb 20, 2023 10:03 PM UTC

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;
			}
		}
	}
}

5 replies

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
Feb 20, 2023 10:03 PM UTC

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;
			}
		}
	}
}
Translate
SmooBG
SmooBGAuthor
Participating Frequently
Feb 20, 2023 10:52 PM UTC

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

Translate