如何使用ControlP5按钮激活/运行另一个处理脚本
我当前的文件夹结构就像
- Parent
- Child1
- Child1.pde
- controlp5_GUI
- controlp5_GUI.pde
我计划在ControlP5_GUI.PDE中使用ControlP5一样。我的最终目标是在用户单击“激活脚本”按钮时运行child1.pde。这在ControlP5中是否可行?如果是这样,怎么样?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
exec()
呼叫processing-java
命令行实用程序启动child1.pde。例如,
在您的情况下,controlp5_gui.pde会称呼类似:
有几个警告需要考虑:
processing-java
将包含在path> path
环境变量中 该与处理可执行文件(在已安装的处理的文件夹中)。processing-java
的绝对路径, /code>路径必须是绝对的。 也可能会有所帮助
如果您需要使用P5从另一个草图中控制草图 “ rel =“ nofollow noreferrer”> ControlP5的帧示例有用。
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.