diff --git a/src/server/slave.c b/src/server/slave.c --- a/src/server/slave.c +++ b/src/server/slave.c @@ -129,8 +129,11 @@ char *pathtoTar; // Full path to the loc char *urltoOutput; // Full URL where output is posted char *pathtoJobfile; // Full path to the job's main file +char *pathtoXml; // Full path to the job's xml file char *pathtoOutput; // Full path to the output (rendered) file +struct distrenjob *myjob; // Structure to hold data gathered from the XML file + // If the slave is getting job info... if(gotframe ==1) { @@ -150,6 +153,7 @@ if(gotframe ==1) _distren_asprintf(&pathtoJobfile, "%s/%s/job.blend", datadir, jobdatapath ); // Prepares the path to the jobfile _distren_asprintf(&urltoOutput, "http://protofusion.org/distren/stor/job%d/output/", jobdatapath ); // Prepares the URL where output is posted + _distren_asprintf(&pathtoXml, "%s/job%d/job%d.xml",datadir, jobnum ); // Prepares the path to the job's XML file _distren_asprintf(&pathtoOutput, "%s/job%d/output/frame%d.%s", datadir, jobnum, framenum, outputExt ); // Prepares the path to the jobfile // Download the data if it isn't present. (prevents re-downloading for same-job frames) @TODO: Delete old job data @@ -169,7 +173,17 @@ if(gotframe ==1) system(tarcmd); free(tarcmd); - // exec_blender(distrenjob, pathtoJobfile, pathtoOutput, framenum); // @TODO: Implement the xml --> struct function + // Grabs data from the XML file, throws it in the myjob struct. + if(xml2distrenjob(&myjob, pathtoXml) == 0){ + fprintf(stderr,"Well, the XML craziness may have worked. Maybe. \n"); + distrenjob_free(&myjob); // Frees things up if it was successful. xml2distrenjob() really only fails if malloc'ing inside it fails + } + else{ + fprintf(stderr,"I think the XML craziness may have failed, so I'll terminate just for fun.\n"); + return 1; + } + + exec_blender(&myjob, pathtoJobfile, pathtoOutput, framenum); // @TODO: Implement the xml --> struct function // Consider placing the following in the exec_blender() function while(busy == 1){ @@ -178,7 +192,7 @@ if(gotframe ==1) sleep(5); // or not... this should be more event-driven, but should still give a heartbeat to the server } busy = 2; - busy = 1; // When done rendering, set this. + busy = 1; // @TODO: When done rendering, set this. } // When blender is finished, run this... if(busy==2){