SilentSys / orhelper

orhelper is a module which aims to facilitate interacting and scripting with OpenRocket from Python
GNU General Public License v2.0
16 stars 17 forks source link

Help needed -- trying to use jogl/opengl? #10

Open JoePfeiffer opened 1 year ago

JoePfeiffer commented 1 year ago

I'm attempting to write an animation showing a rotating rocket in OR's photo studio (see the discussion around the motivation for https://github.com/openrocket/openrocket/issues/2076 to get a sense of what I want to do).

Unfortunately, when I attempt to get the RealisticRenderer using

import net.sf.openrocket.gui.figure3d as f3d
rr = f3d.RealisticRenderer(doc)

I get:

Exception while calling OpenRocket
Traceback (most recent call last):
  File "ClassLoader.java", line 522, in java.lang.ClassLoader.loadClass
java.lang.java.lang.ClassNotFoundException: 

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "org.jpype.pkg.JPypePackage.java", line -1, in org.jpype.pkg.JPypePackage.getObject
java.lang.java.lang.NoClassDefFoundError: 

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/joseph/rockets/openrocket/orhelper/./animation.py", line 36, in 
    rr = f3d.RealisticRenderer(doc)
         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/jpype/imports.py", line 87, in _JExceptionHandler
    raise ImportError("Unable to import '%s' due to missing dependency '%s'" % (
ImportError: Unable to import 'net.sf.openrocket.gui.figure3d.RealisticRenderer' due to missing dependency 'java.lang.NoClassDefFoundError: com.jogamp.opengl.GL'
Traceback (most recent call last):
  File "ClassLoader.java", line 522, in java.lang.ClassLoader.loadClass
java.lang.java.lang.ClassNotFoundException: 

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "org.jpype.pkg.JPypePackage.java", line -1, in org.jpype.pkg.JPypePackage.getObject
java.lang.java.lang.NoClassDefFoundError: 

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/joseph/rockets/openrocket/orhelper/./animation.py", line 36, in 
    rr = f3d.RealisticRenderer(doc)
         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/jpype/imports.py", line 87, in _JExceptionHandler
    raise ImportError("Unable to import '%s' due to missing dependency '%s'" % (
ImportError: Unable to import 'net.sf.openrocket.gui.figure3d.RealisticRenderer' due to missing dependency 'java.lang.NoClassDefFoundError: com.jogamp.opengl.GL'

I've made several attempts to find ways to import com.jogamp.opengl.GL with no luck whatever. The closest I've come has been to extract the contents of the jar using jar xf and adding the location of the jar file to the classpath. When I do this I'm able to import all the opengl classes successfully, but I still get the missing dependency error. I'm attaching the broken code that does that

animation.py.txt