Set Light Type
Posted: February 21st, 2008, 2:37 pm
Anybody know how to set the Light type?
addLight adds a spot light and i want a point light.
Thanks
addLight adds a spot light and i want a point light.
Thanks
Code: Select all
// Import the "light" project
var lightProjName = "light.aep";
var impOpt = new ImportOptions(File(lightProjName)); // same folder as the script
var proj = app.project;
proj.importFile(impOpt);
// Retrieve the comp that contains the light layers
var i, lightComp;
for (i = 1; i <= proj.numItems; i++)
{
if (proj.item(i).name == lightProjName)
{
lightComp = proj.item(i).item(1); // assuming the comp is the first item
break;
}
}
if (lightComp)
{
// Retrieve light layers
var parallelLight = lightComp.layer(1);
var spotLight = lightComp.layer(2);
var pointLight = lightComp.layer(3);
var ambientLight = lightComp.layer(4);
// Add point light to the active comp
var activeComp = proj.activeItem;
pointLight.copyToComp(activeComp);
// Delete imported stuff
proj.item(i).remove();
}