-
How would I go about using Processing Java Libraries? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
Which Processing library would you like to use? Not all of them can be compatible, and not all of them are a good idea to use. For example, there are plenty of good Python physics libraries that can do what Box2D can do. Also, the Processing libraries will not be able to make arbitrary calls to your Python code. Libraries that need to do that won't work. Here's an example of how you can use the Processing library Camera3D: https://github.com/hx2A/py5examples/blob/main/examples/Using%20Camera3D.ipynb The basic idea is to first put the Jars in a Next you need to use
Then you can continue on to use the Processing library to enhance your Sketch. So far I know that PeasyCam, ColorBlindness, and Camera3D all work well with py5. (I created the latter 2, so I made sure they worked) |
Beta Was this translation helpful? Give feedback.
-
Here are the relevant differences:
Did you not try to use the py5 kernel in the previous release? I added the Jupyter related dependencies for the 0.5 release because the two Jupyter kernels both depend on them. The py5 kernel wouldn't have worked in your 0.4 setup. I think perhaps that your 0.4 setup didn't care about libffi.so at all but the 0.5 setup does, and something was compiled against the older version of the library. I did some searching online and it seems this issue is something other libraries are dealing with also. Also, you are using a virttual environment here, right? Not Anaconda? I believe an Anaconda environment would make it easy to install the right version of that shared library. |
Beta Was this translation helpful? Give feedback.
-
Re: using
to import a Java class -> Python class -- have you considered using JImport instead? It appears to support the syntax https://jpype.readthedocs.io/en/devel/imports.html ...and it looks like the behavior is customizable (although I haven't used JPype, I'm just looking through the docs. |
Beta Was this translation helpful? Give feedback.
-
I love PeasyCam, so I have to take the time to figure out the |
Beta Was this translation helpful? Give feedback.
Which Processing library would you like to use? Not all of them can be compatible, and not all of them are a good idea to use. For example, there are plenty of good Python physics libraries that can do what Box2D can do. Also, the Processing libraries will not be able to make arbitrary calls to your Python code. Libraries that need to do that won't work.
Here's an example of how you can use the Processing library Camera3D:
https://github.com/hx2A/py5examples/blob/main/examples/Using%20Camera3D.ipynb
The basic idea is to first put the Jars in a
jars
subdirectory (relative to Python's current working directory). If the Jar file is located somewhere else, usepy5_tools
to add your jar file's…