rayinit in pcomb

Hi Greg,

I have a small ask:

It would be convenient to have access to the rayinit.cal functions within
pcomb expressions. I would propose 2 changes:

1. mimic the behavior of rcalc, where the -f option searches $RAYPATH:

pcomb.c:195: char *fpath;
pcomb.c:209: fpath = getpath(argv[++a], getrlibpath(), 0);
pcomb.c:210: fcompile(fpath);

and then any cal file in RAYPATH (including rayinit) can be easily loaded.
qill this cause issues for users who do not have "." in RAYPATH?

2. preload rayinit.cal prior to option parsing:

#define INITFILE "rayinit.cal"
static char rayinitcal[] = INITFILE;

pcomb.c:195: char *fpath;
pcomb.c:196: fpath = getpath(rayinitcal, getrlibpath(), 0);
pcomb.c:197: fcompile(fpath);

Any drawbacks?

Thanks,

Stephen Wasilewski
*LOISOS *+* UBBELOHDE*
- - - - - - - - - - - - - - - - - - - - - - - - - - -
1917 Clement Avenue Building 10A
Alameda, CA 94501 USA
- - - - - - - - - - - - - - - - - - - - - - - - - - -
510 521 3800 VOICE
510 521 3820 FAX
- - - - - - - - - - - - - - - - - - - - - - - - - - -
www.coolshadow.com

Hi Stephen,

Great suggestion -- I should have made all the commands consistent a long time ago. I've updated genrev, gensurf, genworm, bsdf2klems, bsdf2ttree, and pcomb to search $RAYPATH for -f files.

I didn't add in a default compile for raypath.cal, since this is really designed for the renderers. You can still use "-f rayinit.cal" whenever you like, and it will find it now without the full path.

If "." is not in $RAYPATH, you'll need to specify "./file.cal" if you want something from the current directory. This is the way rcalc already behaves, so at least it's consistent, now.

Cheers,
-Greg

ยทยทยท

From: Stephen Wasilewski <stephen@coolshadow.com>
Date: May 4, 2018 4:24:07 PM PDT

Hi Greg,

I have a small ask:

It would be convenient to have access to the rayinit.cal functions within pcomb expressions. I would propose 2 changes:

1. mimic the behavior of rcalc, where the -f option searches $RAYPATH:

pcomb.c:195: char *fpath;
pcomb.c:209: fpath = getpath(argv[++a], getrlibpath(), 0);
pcomb.c:210: fcompile(fpath);

and then any cal file in RAYPATH (including rayinit) can be easily loaded. qill this cause issues for users who do not have "." in RAYPATH?

2. preload rayinit.cal prior to option parsing:

#define INITFILE "rayinit.cal"
static char rayinitcal[] = INITFILE;

pcomb.c:195: char *fpath;
pcomb.c:196: fpath = getpath(rayinitcal, getrlibpath(), 0);
pcomb.c:197: fcompile(fpath);

Any drawbacks?

Thanks,

Stephen Wasilewski
LOISOS + UBBELOHDE
- - - - - - - - - - - - - - - - - - - - - - - - - - -
1917 Clement Avenue Building 10A
Alameda, CA 94501 USA
- - - - - - - - - - - - - - - - - - - - - - - - - - -
510 521 3800 VOICE
510 521 3820 FAX
- - - - - - - - - - - - - - - - - - - - - - - - - - -
www.coolshadow.com