jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

P3D and OPENGL Not working #369

Open Steve557mag-fr opened 2 years ago

Steve557mag-fr commented 2 years ago

When I try to run my code with P3D or OpenGL, nothing happens. No window appear. Just nothing. I have tried with Processing 4.0.1 and Processing 3.5.4

my code:

def setup():
    size(200,200,P3D)
    background(50)

def setup():
    box(20)

other informations:

  • Windows 10 Pro
  • Intel(R) Core(TM) i5-6500
  • MSI GTX 1050 TI

Maybe I'm missing something in my code ?

Mistera91 commented 2 years ago

I found a workaround, it is to not run your script using Processing editor, but use the command-line processing instead.

Use Processing jar file (can be downloaded at processing.py official website) to run your script and edit it with any code editor.

You will find the processing-py.jar file. Just use command line java 1.8.0 to run it : java -jar processing-py.jar <.pyde script>

This is a dirty workaround but I could not find any better solution

! Important edit !

I forgot the most important part : you need _JAVA_OPTIONS='-Djogl.disable.openglcore=false' (no idea how you pass those options on windows, but for linux you just do export _JAVA_OPTIONS='-Djogl.disable.openglcore=false')

! Re-Edit !

I'm not sure the java option is useful (it throws a X11 error so I'm not sure if you will encounter it with windows), try without it first, then if it doesn't work, try with it

tabreturn commented 2 years ago

You could also add these lines to the top of your sketch --

from java.lang import System
System.setProperty("jogl.disable.openglcore", "false")

source: https://github.com/processing/processing/issues/6061

rors commented 1 year ago

Hello. I am also seeing this error. Same code snippet as above does not run in Python mode with P3D or OPENGL.

Processing 3.5.4 MacBook Air, 1.1 GHz Quad-Core Intel Core i5

Thanks

Mistera91 commented 1 year ago

Don't you have processing 4 instead of 3 ? Also, in the meantime, I found and switched to a processing-like python3 module that actually works, it is named py5 (https://py5coding.org), you should try it out (Edit : email awnser messed up)

rors commented 1 year ago

py5 looks cool but does not solve my problem.

I am trying to get Processing to work in Python mode. I am currently running Processing in version 3.5.4. I would be happy to use Processing 4 instead but my understanding is that it is not compatible with Python mode.

Mistera91 commented 1 year ago

it is not compatible with Python mode.

It is

rors commented 1 year ago

Could you explain or point me to a reference that explains how to use Processing 4 in Python mode? It doesn't seem to work for me at all.

For me (MacOS, Intel, Ventura 13.1) I download Processing 4, open the application, try a one-line sketch (size(400,400)) in Python mode and get this error:

java.lang.NullPointerException
  at jycessing.Runner.runSketchBlocking(Unknown Source)
  at jycessing.mode.run.SketchRunner.lambda$startSketch$3(Unknown Source)
  at java.base/java.lang.Thread.run(Thread.java:833)

I cannot even click the console "Copy" button to copy the error message. (Both this sketch and copying the console work in Java mode.)

Mistera91 commented 1 year ago

Could you explain or point me to a reference that explains how to use Processing 4 in Python mode? It doesn't seem to work for me at all.

Well, for me, the exact same one-liner works. I am running processing 4.0.1 on linux, so I don't know your issue sorry