diff --git a/src/server/slave.c b/src/server/slave.c --- a/src/server/slave.c +++ b/src/server/slave.c @@ -113,13 +113,9 @@ options_init(argc,argv,&my_cfg, myopts, -/* These should all be filled by remotio and other code @TODO: Make this less blender-specific and more jobtype-flexible... how should we go about doing this? */ +/* Code-filled Vars, filled somewhere in the loopage */ int jobnum; -int framenum; - -/* These should be filled by the xml file that comes with a job @TODO: Add calls to the xml function that ohnobinki's working on */ -char *outputExt = "JPG"; -char *outputRes = "1600x1200"; +int framenum; // @TODO: Remotio should fill this int gotframe; // set this to 1 after data for a job is received from the server int busy = 0; // Client business 1=busy 0=idle @@ -131,12 +127,17 @@ char *urltoOutput; // Full URL where o 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 +char *outputExt; // Output Extension (e.g., JPG) struct distrenjob *myjob; // Structure to hold data gathered from the XML file // If the slave is getting job info... if(gotframe ==1) { + /* @TODO: fix these remoteio_read's */ + jobnum = remotio_read(jobnum); // Set jobnum from remoteio (we could use info from struct, but we need this info to download the xmlfile) + framenum = remoteio_read(jobnum); // Set framenum from remoteio + char *tarcmd; char *outdir; char *jobdatapath; @@ -154,7 +155,6 @@ 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 @@ -183,7 +183,12 @@ if(gotframe ==1) return 1; } - exec_blender(&myjob, pathtoJobfile, pathtoOutput, framenum); // @TODO: Implement the xml --> struct function + /* Variable-fillers which require XML */ + outputExt = myjob.outputFormat; + _distren_asprintf(&pathtoOutput, "%s/job%d/output/frame%d.%s", datadir, jobnum, framenum, outputExt ); // Prepares the path to the jobfile + + + exec_blender(&myjob, pathtoJobfile, pathtoOutput, framenum); // @TODO: This warning should be fixed :D // Consider placing the following in the exec_blender() function while(busy == 1){