Here’s the hacky code snippet I use. However, I’ll look into $batchCamera like ivaylo suggested.
global proc string vraySubmit:getRenderableCamera(){
//returns first renderable camera
string $cameraList[] = `listCameras -p -o`;
string $renderCamera;
for($camera in $cameraList){
int $renderable = `getAttr ($camera + ".renderable")`;
if ($renderable){
//setAttr vraySettings.batchCamera -type "string" $camera;
$renderCamera = $camera;
break;
}
}
return $renderCamera;
}