I've altered the Cineon Converter Adj layer script to create a Gamma check layer, but I can't get it to set the Gamma to 5.
Everything else works great except this part.
Here's what I've tried and doesn't work:
levels.property("Levels-0004").setValue(5);
levels.property("Levels-0004").setValue(5.0);
levels.property("Levels-0004").setValue(5.0);
Gamma to 5.00;
All I need is this one line.
Thanks.
Adjust Levels Script
Moderator: byronnash
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
Sorry it's taken so long to respond. Here's a script that should tell you what you need to know, select a layer before running the script.
Code: Select all
{
// you must have a layer selected before running this script
var activeItem = app.project.activeItem;
var activeComp = activeItem;
var theLayer = activeComp.selectedLayers[0];
// apply Levels effect (two naming methods are shown)
//theEffect = theLayer.Effects.addProperty("ADBE Easy Levels");
theEffect = theLayer.Effects.addProperty("Levels");
// loop through effect properties, showing name and matchName
for (var j = 1; j <= theEffect.numProperties; j++) {
alert("Property " + j + "\rname = " + theEffect.property(j).name + "\rmatchName = " + theEffect.property(j).matchName);
}
// here are three possible ways of accessing an effect property
//theEffect.property(5).setValue(5);
//theEffect.property("Gamma").setValue(5);
theEffect.property("ADBE Easy Levels-0005").setValue(5);
}
Here's the code I'm using. I added you code but still can't get it to work.
Thanks for the help
Code: Select all
{
// This script will create an Adjustment layer in the activeComp.
// The adjstment layer will have Levels effect and ...
//
//
// note: This script is using matchName so that this script can work with localized build.
//
var activeItem = app.project.activeItem;
if (activeItem == null || !(activeItem instanceof CompItem)){
alert("Please establish a comp as the active item and run the script again");
} else {
// By bracketing the operations with begin/end undo group, we can
// undo the whole script with one undo operation.
app.beginUndoGroup("Levels Adjust");
var activeComp = activeItem;
var solidName = "GAMMA CHECK";
var solidW = activeComp.width;
var solidH = activeComp.height;
var solidPixelAspectRatio = activeComp.pixelAspect;
var solidDuration = activeComp.duration;
var adjLayer = activeComp.layers.addSolid([1, 1, 1], solidName, solidW, solidH, solidPixelAspectRatio, solidDuration);
// Apply Levels
var levels = adjLayer.Effects.addProperty("Levels");
// Set Values
//levels.property("Levels-0004").setValue(4);
//levels.property("Levels-0004").setValue(4.0);
//Gamma to 5.00;
adjLayer.adjustmentLayer = true;
adjLayer.guideLayer = true;
adjLayer.moveToBeginning();
app.endUndoGroup();
}
}
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
If I replace these lines in your script:
with any one of these lines, it works fine for me.
Code: Select all
//levels.property("Levels-0004").setValue(4);
//levels.property("Levels-0004").setValue(4.0);
//Gamma to 5.00;
Code: Select all
levels.property("ADBE Easy Levels-0005").setValue(5);
levels.property(5).setValue(5);
levels.property("Gamma").setValue(5);