AE ENHANCERS

Expressions/Scripts/Presets
It is currently Sat May 18, 2013 10:09 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: script to toggle cast shadows ON / OFF throughout project?
PostPosted: Fri May 25, 2012 12:26 pm 
Offline

Joined: Thu Dec 16, 2004 11:15 am
Posts: 38
this would be awesome!


Top
 Profile  
 
 Post subject: Re: script to toggle cast shadows ON / OFF throughout projec
PostPosted: Mon Jul 02, 2012 4:54 am 
Offline
User avatar

Joined: Sat Jun 02, 2012 10:08 am
Posts: 4
Works with selected layers.

Select layers and click on checkbox.

Here you are:

Image

Code:
function mainFun()
{

    this.windowRef = null;
}


mainFun.prototype.run = function(){
   
   var retval = true;
   var win = new Window("palette", "On/Off Shadows", [150, 150, 460, 350]);
   this.windowRef = win;

   
   win.checkPanel = win.add("panel", [25, 25, 285, 140], "Cast Shadows");
   win.checkPanel.chkOne = win.checkPanel.add("checkbox", [10, 15, 125, 35], "On/Off Shadows");
   //win.checkPanel.chkTwo = win.checkPanel.add("checkbox", [10, 45, 250, 65], "Current layers (reserved)");
   //win.checkPanel.chkThree = win.checkPanel.add("checkbox", [10, 75, 250, 95], "All layers (reserved)");
     win.quitBtn = win.add("button", [110,160,200,180], "Close");
     

//win.checkPanel.chkTwo.enabled = false;
//win.checkPanel.chkThree.enabled = false;

win.checkPanel.chkOne.onClick = allLayers;

function allLayers () {

if (win.checkPanel.chkOne.value == false){

var curItem = app.project.activeItem;
for (var a = 1; a <= curItem.numLayers; ++a){
var curLayer = curItem.layer(a);
if (curLayer.selected){

var shad = curLayer.property("ADBE Material Options Group").property("ADBE Casts Shadows");

var  pp = shad.setValue(0);
}
}
    }else{
var curItem = app.project.activeItem;
for (var a = 1; a <= curItem.numLayers; ++a){
var curLayer = curItem.layer(a);
if (curLayer.selected){


var shad = curLayer.property("ADBE Material Options Group").property("ADBE Casts Shadows");

var  pp = shad.setValue(1);
}
}
}
}
win.quitBtn.onClick = function() {
       win.close();
   }

    win.center();
   win.show();
   
   return retval;
   
}

if(typeof(mainFun_unitTest) == "undefined") {
    new mainFun().run();
}

_________________
aw-Autosaver powerfull Auto-Save replacement


Last edited by AlexG on Tue Jul 03, 2012 2:27 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: script to toggle cast shadows ON / OFF throughout projec
PostPosted: Tue Jul 03, 2012 11:10 am 
Offline

Joined: Thu Aug 12, 2010 1:50 am
Posts: 3
hi here is one for Cast Shadows,Accepts lights,Accepts shadows

http://digitalvideoschnitt.de/forum/ado ... cript.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group