Enable "//" on OSL paths

OSL is an incredibly useful addition to the Blender program; but referencing a file name (in, for example, one of the texture or texture3D functions) requires an absolute path. I’ve seen from an experiment with fprintf that the working directory is Blender’s program working directory, not the project’s directory, and I honestly can’t think of a case where that would help.

However, unlike Python and the rest of the UI, prefixing with “//” does not give me the project directory but rather an unusable path. Because of this, I frequently need to specify absolute paths to resources, which hurts file portability very much.

Would it be possible to either add “//” functionality to OSL paths, or set the OSL working directory to the project folder?

I’ve found that if I make the file name a parameter on my shader function, and use the corresponding input field on the script node, I can use //. It’s only within the OSL code itself that this becomes a problem.