Processing.py-Bugs icon indicating copy to clipboard operation
Processing.py-Bugs copied to clipboard

P3D and OPENGL Not working

Open Steve557mag-fr opened this issue 2 years ago • 8 comments

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 ?

Steve557mag-fr avatar Nov 09 '22 10:11 Steve557mag-fr

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

Mistera91 avatar Nov 20 '22 15:11 Mistera91

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

tabreturn avatar Nov 21 '22 20:11 tabreturn

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

rors avatar Jan 25 '23 21:01 rors

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)

Mistera91 avatar Jan 25 '23 21:01 Mistera91

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.

rors avatar Jan 25 '23 21:01 rors

it is not compatible with Python mode.

It is

Mistera91 avatar Jan 25 '23 21:01 Mistera91

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.)

rors avatar Jan 26 '23 13:01 rors

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

Mistera91 avatar Jan 26 '23 13:01 Mistera91