My current folder structure is like
- Parent
- Child1
- Child1.pde
- controlp5_GUI
- controlp5_GUI.pde
I plan to use controlp5 inside controlp5_GUI.pde. My final objective is to run child1.pde when the user clicks "Activate Script" button. Is this doable in controlp5? If so, how?
You can use
exec()
to call theprocessing-java
command line utility to launch Child1.pde. e.g.In your case controlp5_GUI.pde would call something like:
There are a couple of caveats to take into account:
processing-java
to be included into thePATH
environment variable (otherwise you will need provide the absolute path toprocessing-java
which lives in the same folder as the processing executable (in the folder where you've installed Processing).--sketch
path needs to be absolute.This similar answer might be helpful too.
If you need to control a sketch from another sketch using P5 you might find ControlP5's frame example useful.