Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Feb 20, 2023 Feb 20, 2023

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!

TOPICS
How to , Scripting
728
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 20, 2023 Feb 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;
			}
		}
	}
}
Translate
Community Expert ,
Feb 20, 2023 Feb 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;
			}
		}
	}
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2023 Feb 20, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2023 Feb 20, 2023

Holy crap!  That worked like a charm!  Thanks so much, Dan!  :party_popper:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2025 Feb 04, 2025

where should i add this script?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 04, 2025 Feb 04, 2025
LATEST

You would save it somewhere as a .jsx file, then:

File > Scripts > Run Script File > (navigate to the file)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines