Preparing a rendered exr with multiple render layers
I'm a complete newb to this so please bear with me. I want to automate the process of preparing rendered exr's
I used the script listener to create what I need to do, however, some of my files have variables.
For example, i may be supplied with i file that doesn't have certain elements in it, this obviously breaks the script.
The example here shows that the file has layers called "multimatte.RGB" sometimes I have 1, the example bellow selects 3 layers but sometimes i don't have any layers named this. How do i get it to work as an if?
var idslct = charIDToTypeID( "slct" );
var desc179 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref163 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref163.putName( idLyr, "multimatte.RGB" );
desc179.putReference( idnull, ref163 );
var idMkVs = charIDToTypeID( "MkVs" );
desc179.putBoolean( idMkVs, false );
executeAction( idslct, desc179, DialogModes.NO );
// =======================================================
var idslct = charIDToTypeID( "slct" );
var desc180 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref164 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref164.putName( idLyr, "multimatte2.RGB" );
desc180.putReference( idnull, ref164 );
var idselectionModifier = stringIDToTypeID( "selectionModifier" );
var idselectionModifierType = stringIDToTypeID( "selectionModifierType" );
var idaddToSelectionContinuous = stringIDToTypeID( "addToSelectionContinuous" );
desc180.putEnumerated( idselectionModifier, idselectionModifierType, idaddToSelectionContinuous );
var idMkVs = charIDToTypeID( "MkVs" );
desc180.putBoolean( idMkVs, false );
executeAction( idslct, desc180, DialogModes.NO );
Thanks
