--- ray/src/ot/obj2mesh.c 2004/04/22 17:35:54 2.10 +++ ray/src/ot/obj2mesh.c 2007/07/12 14:58:53 2.12 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: obj2mesh.c,v 2.10 2004/04/22 17:35:54 greg Exp $"; +static const char RCSid[] = "$Id: obj2mesh.c,v 2.12 2007/07/12 14:58:53 greg Exp $"; #endif /* * Main program to compile a Wavefront .OBJ file into a Radiance mesh @@ -22,7 +22,7 @@ char *progname; /* argv[0] */ int nowarn = 0; /* supress warnings? */ -int objlim = 15; /* # of objects before split */ +int objlim = 9; /* # of objects before split */ int resolu = 16384; /* octree resolution limit */ @@ -39,7 +39,10 @@ main( /* compile a .OBJ file into a mesh */ ) { int nmatf = 0; - char *matinp[32]; + char pathnames[12800]; + char *pns = pathnames; + char *matinp[128]; + char *cp; int i, j; progname = argv[0]; @@ -55,6 +58,18 @@ main( /* compile a .OBJ file into a mesh */ break; case 'a': /* material file */ matinp[nmatf++] = argv[++i]; + break; + case 'l': /* library material */ + cp = getpath(argv[++i], getrlibpath(), R_OK); + if (cp == NULL) { + sprintf(errmsg, + "cannot find library material: '%s'", + argv[i]); + error(USER, errmsg); + } + matinp[nmatf++] = strcpy(pns, cp); + while (*pns++) + ; break; case 'w': /* supress warnings */ nowarn = 1;