diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -87,3 +87,52 @@ int main(int argc, char *argv[]) return 0; } + + +/* Blender Rendering Code: + +/////////////////////// MASTER /////////////////////////////// + +// MySQL Setup Code (put in common maybe) +#include +MYSQL *conn; +MYSQL_RES *res; +MYSQL_ROW row; +// + char *server = "localhost"; // change if/when we do the multiserver setup... then distributed mysql with ssl? haha + char *user = "mysql"; + char *password = "mysql"; // heh + char *database = "distrend"; // check... I think this exists already on my server(s) +// +conn = mysql_init(NULL); +if (!mysql_real_connect(conn, server, user, password, database, 0, NULL, 0)) { fprintf(stderr, "%s\n", mysql_error(conn)); return (0); } + + + + +// Queuer +void queue(char *filename, int priority, char name, char submitter, char contact) { + +// Todo... store frame status in mysql tables, along with table with list of jobs/submitters/contact info/whatever else we want + +} + + + +///////////////////////// SLAVE /////////////////////////////// + + +// Execution Function +void blendrend(char *input, char *output, int sframe, int eframe) { + int ret; + char *cmd[] = { "blender", "-b", "-o", output, input, "-s", sframe, "-e", eframe, (char *)0 }; + ret = execv ("/usr/bin/blender", cmd); + // fprintf(stderr, "blender -b -o %s %s -s %d -e %d \n",output,input,sframe,eframe); +} +blendrend(input,output,100, 206); // arbitrary example referencing the function + + + + + + */