93 |
|
int noaction = 0; /* take no action? */ |
94 |
|
|
95 |
|
char *remsh; /* remote shell program/script */ |
96 |
< |
char rendopt[2048] = ""; /* rendering options */ |
96 |
> |
char rendopt[2048]; /* rendering options */ |
97 |
|
char rresopt[32]; /* rendering resolution options */ |
98 |
|
char fresopt[32]; /* filter resolution options */ |
99 |
|
int pfiltalways; /* always use pfilt? */ |
150 |
|
cfname = argv[i]; |
151 |
|
/* load variables */ |
152 |
|
loadvars(cfname); |
153 |
+ |
/* check variables */ |
154 |
+ |
checkvalues(); |
155 |
|
/* did we get DIRECTORY? */ |
156 |
|
checkdir(); |
157 |
|
/* check status */ |
232 |
|
} |
233 |
|
/* assume it is dead */ |
234 |
|
} |
235 |
< |
if (strcmp(cfname, astat.cfname) && astat.tnext != 0) { /* other's */ |
235 |
> |
if (strcmp(cfname, astat.cfname) && astat.pid != 0) { /* other's */ |
236 |
|
fprintf(stderr, "%s: unfinished job \"%s\"\n", |
237 |
|
progname, astat.cfname); |
238 |
|
return(-1); |
302 |
|
setdefaults() /* set default values */ |
303 |
|
{ |
304 |
|
extern char *atos(); |
305 |
+ |
int decades; |
306 |
|
char buf[256]; |
307 |
|
|
308 |
|
if (vdef(ANIMATE)) { |
336 |
|
quit(1); |
337 |
|
} |
338 |
|
if (!vdef(BASENAME)) { |
339 |
< |
sprintf(buf, "%s/frame%%03d", vval(DIRECTORY)); |
339 |
> |
decades = (int)log10((double)vint(END)) + 1; |
340 |
> |
if (decades < 3) decades = 3; |
341 |
> |
sprintf(buf, "%s/frame%%0%dd", vval(DIRECTORY), decades); |
342 |
|
vval(BASENAME) = savqstr(buf); |
343 |
|
vdef(BASENAME)++; |
344 |
|
} |
450 |
|
char combuf[256]; |
451 |
|
register int i; |
452 |
|
register char *cp; |
453 |
+ |
char *pippt; |
454 |
|
/* create rad command */ |
455 |
|
sprintf(rendopt, " @%s/render.opt", vval(DIRECTORY)); |
456 |
|
sprintf(combuf, |
457 |
|
"rad -v 0 -s -e -w %s OPTFILE=%s | egrep '^[ \t]*(NOMATCH", |
458 |
|
rfargs, rendopt+2); |
459 |
|
cp = combuf; |
460 |
< |
while (*cp) cp++; /* match unset variables */ |
460 |
> |
while (*cp) { |
461 |
> |
if (*cp == '|') pippt = cp; |
462 |
> |
cp++; |
463 |
> |
} /* match unset variables */ |
464 |
|
for (i = 0; mvar[i] >= 0; i++) |
465 |
|
if (!vdef(mvar[i])) { |
466 |
|
*cp++ = '|'; |
467 |
|
strcpy(cp, vnam(mvar[i])); |
468 |
|
while (*cp) cp++; |
469 |
+ |
pippt = NULL; |
470 |
|
} |
471 |
< |
sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY)); |
472 |
< |
cp += 11; /* point to file name */ |
471 |
> |
if (pippt != NULL) |
472 |
> |
strcpy(pippt, "> /dev/null"); /* nothing to match */ |
473 |
> |
else { |
474 |
> |
sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY)); |
475 |
> |
cp += 11; /* point to file name */ |
476 |
> |
} |
477 |
|
if (system(combuf)) { |
478 |
|
fprintf(stderr, "%s: error executing rad command:\n\t%s\n", |
479 |
|
progname, combuf); |
480 |
|
quit(1); |
481 |
|
} |
482 |
< |
loadvars(cp); /* load variables and remove file */ |
483 |
< |
unlink(cp); |
482 |
> |
if (pippt == NULL) { /* load variables and remove file */ |
483 |
> |
loadvars(cp); |
484 |
> |
unlink(cp); |
485 |
> |
} |
486 |
|
} |
487 |
|
|
488 |
|
|
914 |
|
strcat(combuf, viewopt(vp)); |
915 |
|
if (vbool(RTRACE)) |
916 |
|
sprintf(combuf+strlen(combuf), " -ff -fr '%s -w0 %s'", |
917 |
< |
rendopt, vval(OCTREE)); |
917 |
> |
rendopt+1, vval(OCTREE)); |
918 |
|
if (vdef(PINTERP)) |
919 |
|
sprintf(combuf+strlen(combuf), " %s", vval(PINTERP)); |
920 |
|
if (usepfilt) |