script to toggle cast shadows ON / OFF throughout project?
Moderator: byronnash
Works with selected layers.
Select layers and click on checkbox.
Here you are:

Select layers and click on checkbox.
Here you are:

Code: Select all
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();
}
Last edited by AlexG on July 3rd, 2012, 2:27 pm, edited 1 time in total.
aw-Autosaver powerfull Auto-Save replacement
hi here is one for Cast Shadows,Accepts lights,Accepts shadows
http://digitalvideoschnitt.de/forum/ado ... cript.html
http://digitalvideoschnitt.de/forum/ado ... cript.html