/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////					queueRender by Michael Cardeiro				/////////////////////////
////////--------------------------------------------------------------------------------------------------------------///////////
//																|
//	multi machine render using identical projects.  look at each queue, if file exists, skip				|
//																|						|
//------------------------------------------------------------------------------------------------------------------------------|


	VERSION		= 1.0;
	q		= app.project.renderQueue;
	renders		= new Array;
	run		= 1;



	for(x=1; x<= q.numItems; ++x){ 
		if(q.item(x).render){
			q.item(x).render = false;
			renders.push(q.item(x));
		}
	}

//render all, skip ones that exist//run twice incase another instance dropped off mid render
for(y=0; y<=1; ++y){
	for(x=0; x< renders.length; ++x){ 
		if(!renders[x].outputModules[1].file.exists && run){
			renders[x].render = true;
			q.render();
			if(renders[x].status == 2417){
				renders[x].outputModules[1].file.remove();
				run = 0;
				break;
			}
		}
	}
	
}