librocket GUI support

Assuming you mean the Windows SDK build, no, it does not. The next build will.

Sorry if I ask weird questions, or something. I’m pretty new.

But i’m busy with some project in Panda3D, And would really like to use librocket (seems to be a lot better dan DirectGUI to me), I now use the stable version.

My question to the developers is, when will this be in the stable version of Panda? I don’t ask an exact date, but, are we speaking about 5 weeks, 4 months or 2 years?

Just to know if it’s worth the effort to even start to learn DirectGUI.

Thanks a lot!

Stable as in 1.8.1, you mean?

Librocket already is included in 1.8.0, which is considered the current stable release (although releases with a zero at the end of the version number are not as stable as the following ones).

Only thing that is not uncluded in the 1,8,0 release is the librocket debugger, which is helpful, but not necessarily required for using rocket.

BTW:
I’m always using snapshots and never had any major problems with anything.

Well, this page http://www.panda3d.org/download.php?sdk states that 1.8.0 is likely to be unstable, so I choose for 1.7.2, just to be safe (Again, I’m new, so :slight_smile: )

But if 1.8.0 includes librocket, and it is not unstable, I will download that right away :wink:

Thanks for your help Nemesis!

Edit: I downloaded and installed 1.8.0 (1.8.0-1~oneiric3 to be precise), and when I try to execute this testscript:

from direct.showbase.ShowBase import ShowBase

print "Imported ShowBase."

import rocket

print "Imported rocket."

from panda3d.rocket import RocketRegion, RocketInputHandler

print "Imported panda3d.rocket."


class MyApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

        print "ShowBase init finished."

        r = RocketRegion.make('pandaRocket', self.win)
        r.setActive(1)

        print "RocketRegion created."

        ih = RocketInputHandler()
        self.mouseWatcher.attachNewNode(ih)
        r.setInputHandler(ih)

        print "RocketInputHandler created."

        context = r.getContext()

        print "Got rocket context."


app = MyApp()
app.run() 

It gives this ouput:

But rocket is included in Panda, so I don’t know what to do, install it by myself?

Only rocket modules you need are in the panda3d.rocket package.

You shouldn’t import “rocket”.

Beside that you’ll need to load a font into Rocket, before it can write any text.

Take a close look at the sample provided by rdb and try to run that first.

Oh ok, sorry!

Sorry I’m causing a lot of trouble.

Carharttguy

That’s odd. Are you sure you removed the old version of Panda3D first, and installed Panda3D 1.8.0 from the download page?

If you’re sure, can you verify if /usr/lib/panda3d contains a _rocketcore.so and libp3rocket.so file?

Ok, I check /usr/lib and found 2 files related to librocket:

  • libp3rocket.so
  • libp3rocket.so.1.8

So, the _rocketcore file was missing.
Next, I deleted the 1.8.0 version, and reïnstalled it.

No luck, still can’t find the _rocketcore.so. Maybe if someone wants to upload it, I can just paste it into the folder?

Thanks in advance!

I don’t have the _rocketcore.so either, but for me everything works anyway.

Hmm, that’s strange. Someone else has reported the same issue to me earlier, but he reported that getting the latest devel build worked for him. Could you try that and see if it works for you?

I downloaded the latest devel build (from today). And I have the _rocketcore.so file!

But… When opening the rocket-sample’s test.py, I got this:

So, now I’m in need of libRocketDebugger, which is not in my panda3d directory… :frowning:

Thanks for al you guys help. :slight_smile:

Sorry, my bad, I made a mistake when programming the buildbot. Let me know on which os/version/arch you are and I’ll poke the buildbot to roll out a build for you. Or you can wait till tomorrow’s build.

No problem!

No need to build it for me only, I’ll just download new version tomorrow :wink:

Thanks!

In 1.8.0 can I create a p3d with libRocket? When I try I get this during the pack process:

There are some missing modules: ['panda3d.core', 'panda3d.rocket']

And this when I run it:

Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "C:\Users\Chris\Modifire\net\modifire\main.py", line 39, in <module>
    from gui.menus.MainMenu import MainMenu
  File "VFSImporter", line 153, in load_module
  File "C:\Users\Chris\Modifire\net\modifire\gui\menus\MainMenu.py", line 13, in <module>
    import Globals
  File "VFSImporter", line 153, in load_module
  File "C:\Users\Chris\Modifire\net\modifire\Globals.py", line 2, in <module>
    from panda3d.rocket import RocketRegion, RocketInputHandler, LoadFontFace
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\bin\panda3d.py", line 209, in __getattr__
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\bin\panda3d.py", line 129, in libimport
ImportError: DLL loader cannot find _rocketcore.

The game runs with librocket if I start it from the python script.

Installed latest devel build from today, and guess what? Librocket works like a charm!

Thanks for all your work rdb :slight_smile:

BTW: If I can ask, you work a lot on panda3D, do you work for the University or Disney? Because, Panda3D seems to be very active for a open-source project?

cheers
Mathias

@EdBighead: you need to specify “-r rocket” on the packp3d command-line.

@carhartguy: the latter.

Can anyone here get return/enter (’\n’) working in multi-line textarea’s? I’ve read a couple of places on the libRocket forums saying it works, just you need to send the ‘\n’ character through to libRocket when the enter key is pressed, using Rocket::Core::Context::ProcessTextInput() function, and it’ll start a new line

So there must be one of three problems:

  1. My application has done something wrong, and that’s why it’s broken, I figure unlikely.

  2. Panda’s rocketInputHandler class, never calls ProcessTextInput() for the ‘\n’ character upon enter/return, I dunno the code well enough to tell

  3. Panda’s SDK is built with an older version of libRocket possibly and (perhaps?) this new functionality is only in newer github versions of libRocket?

I guess I’d just like to know if anyone else has gotten it to work, or if anyone can investigate a little bit if you know more than me ;D

EDIT: Also on a side note, how can one clean up a rocketRegion? is a call to rocketRegion.setActive(False) good enough? after that as long as the garbage collector gets it (or I explicitly call del on the rocketRegion?)

Thank you,
~powerpup118

Sorry about that. I’ve checked in a fix. Will be in 1.8.1.

You have to call window.removeDisplayRegion(rocketRegion) to remove Panda’s internal reference to your region, allowing it to be destructed when you clear up your references.

Note that calling “del variable” is functionally little different than doing “variable = None”. “del” doesn’t actually destroy the object like “delete” does in C++; it simply removes the reference to the object.

Great news! You’ve completely cleared up my questions. And no worries, I can certainly wait for 1.8.1 no problem.

Good to know about the “del variable” vs “variable = None”, thank you for the heads up!

Thank you again,
~powerpup118

I may have found another bug, or maybe it’s an issue with my ppackage system (in place of packp3d, i’m using ppackage)

Here goes:

I have a simple python file, ‘main.py’ which has these lines:

import panda3d.rocket
print '1'

from panda3d.rocket import *
print '2'

The code works on 1, ‘import panda3d.rocket’, and fails on 2, ‘from panda3d.rocket import *’

I believe the panda3d.rocket pdef package is missing libboost_python.so.1.48.0 based of the errors, here’s the output the program above would spit out (with some other useless parts of my own code output removed):

1
Traceback (most recent call last):
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/PackageInstaller.py", line 427, in __packageDone
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/PackageInstaller.py", line 481, in __callDownloadFinished
  File "wmLauncher/wmLauncher.py", line 103, in downloadFinished
  File "wmLauncher/wmLauncher.py", line 89, in loadGame
  File "VFSImporter", line 153, in load_module
  File "main.py", line 4, in <module>
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/lib/panda3d.py", line 200, in __getattr__
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/lib/panda3d.py", line 112, in libimport
  File "VFSImporter", line 127, in load_module
  File "VFSImporter", line 228, in _import_extension_module
ImportError: libboost_python.so.1.48.0: cannot open shared object file: No such file or directory
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 638, in run
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/task/Task.py", line 502, in run
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/task/Task.py", line 460, in step
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/PackageInstaller.py", line 427, in __packageDone
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/direct/p3d/PackageInstaller.py", line 481, in __callDownloadFinished
  File "wmLauncher/wmLauncher.py", line 103, in downloadFinished
  File "wmLauncher/wmLauncher.py", line 89, in loadGame
  File "VFSImporter", line 153, in load_module
  File "main.py", line 4, in <module>
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/lib/panda3d.py", line 200, in __getattr__
  File "/home/buildbot/slave/release_rtdist_linux_i386/build/panda3d/built_cmu/lib/panda3d.py", line 112, in libimport
  File "VFSImporter", line 127, in load_module
  File "VFSImporter", line 228, in _import_extension_module
ImportError: libboost_python.so.1.48.0: cannot open shared object file: No such file or directory
:TaskManager: TaskManager.destroy()
:display: Closing glxGraphicsWindow
Successfully joined thread: 0
Failure on startup.

It could just be a problem on my end, again, so I dunno for sure yet, I just thought I’d ask if perhaps there is an issue with the libRocket pdef package, or, what you think it might be, etc

Thank you,
~powerpup118