dfile=node.parm("datafile").eval()# data file to read in - Parameter type: File
i.e. add a parameter to the Python SOP called "datafile" of type File. You can use the file browser to define the path to a file, relative to $HIP e.g.
gives you your current File. os.getenv("HIPFILE") os.getenv("HIP") are also possible.
Thanks, GOgraphR, it's good to know there are a number of ways to do this. As I mentioned, I went with a File parameter of type File added to the Python SOP. It works well in my context. Thanks
However, I'd like to be able to define the file path relative to $HIP
This is what triggered me...
I did it your way on some other project.
My approach: If I cannot do something in VEX, or in Python, but can do it in the other context I use detail attributes to transfer the information, or I also like to _abuse_ parameter fields...