I’m using loadShader() and loading a file which is saved to the data folder. I changed my sketch to include a custom main() function, however the loadShader function doesn’t work after that (Processing 3.3.7, Windows 10 64).
Any tips on how to make this work? Hardcoding the full path to the shader file works, but obviously not a practical solution.
static public void main(String[] args) {
String[] appletArgs = new String[] { "BlurFilter"};
PApplet.main(appletArgs);
}
PS: I raised this issue also in Github (issue 5615. I doubt I’m the first one to face this problem, therefore I’m cross posting, hoping there is a workaround, by writing the code in a different way.
hi @GoToLoop
You are right, in the sense that file loading functions will work, if you export the sketch works without a custom main(String[] args) in the sketch
Just to make sure if the sketchPath is still recognized in recent Processing versions when we run the exported sketch using a customized main(), I’ve coded this simple test sketch below:
Hi @GoToLoop, thank you for engaging and for your time testing it. I was wondering, does it matter where you have Processing installed, and where you have your sketches saved?
Does your example also returns the correct path when running from Processing (before exporting)?
In my computer Processing is installed (=unzipped) at C:\processing-3.3.7, which is the path returned by sketchPath. My sketches are not under that path, they are at e.g. c:\Github\RepositoryName\SketchName