librocket GUI support

Return to Panda Features in Development

Postby carharttguy » Mon Feb 27, 2012 6:24 am

rdb wrote: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:

Traceback (most recent call last):
File "test.py", line 1, in <module>
from panda3d.rocket import *
File "/usr/share/panda3d/panda3d.py", line 200, in __getattr__
for obj in dir(self.__manager__.libimport(lib)):
File "/usr/share/panda3d/panda3d.py", line 112, in libimport
return __import__(name)
ImportError: libRocketDebugger.so.1: cannot open shared object file: No such file or directory


So, now I'm in need of libRocketDebugger, which is not in my panda3d directory.. :(

Thanks for al you guys help. :)
carharttguy
 
Posts: 34
Joined: Tue Feb 21, 2012 11:33 am
Location: Belgium

Postby rdb » Mon Feb 27, 2012 7:02 am

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.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby carharttguy » Mon Feb 27, 2012 9:14 am

No problem!

No need to build it for me only, I'll just download new version tomorrow ;)

Thanks!
carharttguy
 
Posts: 34
Joined: Tue Feb 21, 2012 11:33 am
Location: Belgium

Postby EdBighead » Mon Feb 27, 2012 3:09 pm

In 1.8.0 can I create a p3d with libRocket? When I try I get this during the pack process:
Code: Select all
There are some missing modules: ['panda3d.core', 'panda3d.rocket']

And this when I run it:
Code: Select all
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.
EdBighead
 
Posts: 109
Joined: Tue Jan 18, 2011 12:14 pm
Location: U.S.

Postby carharttguy » Tue Feb 28, 2012 3:47 am

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

Thanks for all your work rdb :)

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
carharttguy
 
Posts: 34
Joined: Tue Feb 21, 2012 11:33 am
Location: Belgium

Postby rdb » Tue Feb 28, 2012 4:23 am

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

@carhartguy: the latter.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby powerpup118 » Sun Mar 04, 2012 2:53 pm

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
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby rdb » Sun Mar 04, 2012 4:16 pm

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.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby powerpup118 » Sun Mar 04, 2012 6:37 pm

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
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby powerpup118 » Fri Mar 09, 2012 10:40 pm

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:

Code: Select all
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):

Code: Select all
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
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby powerpup118 » Sat Mar 10, 2012 8:12 pm

I must apologize for both, my long posts, and if I've sent anyone on a wild goose chase.

I have discovered more accurately when the situation happens, and have two new test cases for you..

1) When rocket is required as a package through packp3d, there is no issue and everything works as desired, see code below
Code: Select all
import direct.directbase.DirectStart
from panda3d.rocket import *

run()


Compile that into a p3d file using:
Code: Select all
packp3d -o myapp.p3d -r rocket


No issue occurs.


2) When rocket is installed at-runtime (which I seem to be able to do with other packages, bullet, my own packages, etc) there is the "ImportError: libboost_python.so.1.48.0: cannot open shared object file: No such file or directory" error, which may be due to my own lacking knowledge of the package system. See the below:
Code: Select all
import direct.directbase.DirectStart
from direct.p3d.DWBPackageInstaller import DWBPackageInstaller

def onFinish(worked):
   print 'onFinish(%s)' % worked
   from panda3d.rocket import LoadFontFace

pi = DWBPackageInstaller(base.appRunner, parent = base.a2dTopRight, scale = 0.5, pos = (-0.6, 0, -0.1), finished = onFinish)

pi.addPackage('rocket', 'cmu_1.8')
pi.donePackages()

run()

As you can see, the above code will install the rocket package at runtime, and once done, attempt to load the rocket module (by simply importing LoadFontFace from panda3d.rocket module)

Compile the above into a p3d simply with:
Code: Select all
packp3d -o myapp.p3d


So it appears my new question is, why can other panda3d C modules/packages, such as Bullet, be installed at runtime, and the rocket C module/package is the opposite, with the missing libboost_python... error?

I apologize for the incorrect information before,
Thank you,
~powerpup118
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby rdb » Tue Mar 13, 2012 3:49 am

Bah. Somehow it must be grabbing the librocket libraries on your system instead of the librocket libraries in the rtdist.

The only way I see to fix this is for me to rename the libRocket libraries into something else, and then linking to those.

I'm busy at the moment with other tasks, so please file a bug report.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby powerpup118 » Tue Mar 13, 2012 4:11 am

Okay, I'll go ahead and file a bug report about this.

Since it's grabbing the libRocket libraries from my own system, in theory, the problem should be non existent for anyone who has never installed libRocket, (directly as a system install, I mean), is that correct?

I'll go ahead and test this theory as well, and if it's different from what I think, I'll let you know on the bug tracker.

Appreciate your time,
~powerpup118
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby rdb » Tue Mar 13, 2012 7:03 am

You can easily test it by simply renaming the libRocket libraries on your system, or moving them to another directory.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby DangerOnTheRanger » Wed Mar 14, 2012 2:54 pm

When I run the following program:

Code: Select all
from direct.showbase.ShowBase import ShowBase
from panda3d.rocket import *

class MyApp(ShowBase):

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

app = MyApp()
app.run()


I get this exception:

Code: Select all
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/share/panda3d/panda3d.py", line 200, in __getattr__
    for obj in dir(self.__manager__.libimport(lib)):
  File "/usr/share/panda3d/panda3d.py", line 129, in libimport
    raise ImportError, message
ImportError: DLL loader cannot find _rocketcore.


This ImportError occurs with both 1.8 and the latest Lucid Lynx buildbot. Like carthartguy, I too have no _rocketcore.so file in /usr/lib/panda3d. Plus this problem occurs both with and without librocket being separately installed on my system. Anyone have any suggestions?
Free + open-source game development kit: http://openblox.sourceforge.net

My blog: http://dangerontheranger.blogspot.com
User avatar
DangerOnTheRanger
 
Posts: 240
Joined: Fri Aug 27, 2010 4:59 pm

Postby rdb » Wed Mar 14, 2012 3:49 pm

Sorry, I must have forgotten to build libRocket on lucid lynx.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby DangerOnTheRanger » Wed Mar 14, 2012 5:19 pm

So can I expect librocket to be in the Lucid Lynx build by tommorrow?
Free + open-source game development kit: http://openblox.sourceforge.net

My blog: http://dangerontheranger.blogspot.com
User avatar
DangerOnTheRanger
 
Posts: 240
Joined: Fri Aug 27, 2010 4:59 pm

Postby rdb » Thu Mar 15, 2012 6:13 am

The current lucid builds (as of this very moment) should contain libRocket support.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby DangerOnTheRanger » Thu Mar 15, 2012 12:58 pm

Thanks, rdb - librocket works with the Lucid Lynx build now :)
Free + open-source game development kit: http://openblox.sourceforge.net

My blog: http://dangerontheranger.blogspot.com
User avatar
DangerOnTheRanger
 
Posts: 240
Joined: Fri Aug 27, 2010 4:59 pm

Postby powerpup118 » Thu Mar 15, 2012 2:52 pm

Hi again all,

I have a sort of suggestion/feature request I suppose, it's however specifically relate to rocket, sso instead of posting it under Feature Request I thought I'd post it here.

libRocket allows C++ users to inherit from Rocket::Core::Element, and then define onUpdate/onRender calls for that specified element, and then it will be properly drawn in order, with respect to other elements.

For an example, a minimap, or some sort of 3d character drawn "onto" an libRocket window, using your own custom element tag.

See this libRocket thread on their forums here

Also see ElementGame.cpp in libRocket/Samples/pyinvaders/rc/ElementGame.cpp

This is an example of such usage, and I can see this being indeed very useful.

I was thinking of some sort of "rocketElementNode" or something of the sort, which could have a tag, and inherit from Rocket::Core::Element, and then any panda3d geom's etc under that node would be drawn in the onRender/onUpdate callback or however that works

This is just an suggestion, and I'm more than aware that this requires C++ work that perhaps nobody is willing or knowledgeable enough to do.

Just an idea,
~powerpup118
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby rdb » Fri Mar 16, 2012 1:36 pm

Intriguing. I'll look into it.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby rdb » Fri Mar 23, 2012 3:30 pm

It wouldn't work. Interrogate doesn't support overriding virtual methods from C++. Boost::python does, however, so nothing is stopping you from inheriting directly from Rocket::Core::Element.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby wraithix » Sat Apr 14, 2012 8:56 am

I'm having a bit of trouble changing properties at runtime - and I'm kind of assuming I just don't understand the libRocket API well enough - but whenever I try to change an object property once run() is called it either crashes my application or does nothing.

What I'm trying to do is create a text field I can update as needed, but I get the following error:

Code: Select all
Boost.Python.ArgumentError: Python argument types in
    None.None(Element, unicode)
did not match C++ signature:
    None(class Rocket::Core::Element {lvalue}, class Rocket::Core::StringBase<char>)


I've tried using a <div> and a <p>. From what I gather a div is translated into an Element, and a <p> is translated into an ElementText. Respectively, I've tried assigning document.getElementById('id').inner_rml and document.getElementById('id').text directly. The <div> property crashes with the above error, and the <p> method doesn't seem to do anything. I've tried calling context.Update() after the <p> property, but that doesn't help.

If I change these properties before Panda's run() method is called I have no issues, but once run() is called the <div> method crashes and the <p> method doesn't do anything. I'm assuming I'm just doing this wrong. What's the right way to do this is? Any help would be much appreciated.
wraithix
 
Posts: 27
Joined: Wed Dec 23, 2009 1:57 am

Postby wraithix » Sat Apr 14, 2012 6:59 pm

I've figured it out. When assigning a value directly it is a string type, but when assigning as a variable it was a unicode type. By casting the value with str() before assigning it worked.
wraithix
 
Posts: 27
Joined: Wed Dec 23, 2009 1:57 am

Postby plaristote » Fri May 18, 2012 9:31 am

Hi there !

It's great news that Rocket is getting integrated in Panda3D ! And I'd like to try it out : I compiled it alright and can use it, but I just don't know how.

The RocketNode object from the first post doesn't exist anymore (does it ?).
I have a RocketRegion, with and a successfully loaded ElementDocument, but I don't know how to display it into Panda.
I didn't find anything in the documentation to create a PandaNode.

Is there any way to see a sample of code in C++ ?
Potato.
plaristote
 
Posts: 113
Joined: Sat May 12, 2012 2:02 pm

Postby rdb » Fri May 18, 2012 12:54 pm

rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby plaristote » Sat May 19, 2012 7:24 am

Alright thank you ! I managed to write it in C++ and it works wonders !

But there's a problem I know how to solve with PGButtons but not with the libRockets !

If you want to ignore the clicks intercepted by a PGButton, you would do this :
Code: Select all
button->get_region()->set_suppress_flags(MouseWatcherRegion::SF_mouse_button);

But I can't find a way to do this with RocketRegions. Is there something to do that ?
Potato.
plaristote
 
Posts: 113
Joined: Sat May 12, 2012 2:02 pm

Postby rdb » Sun May 20, 2012 3:22 am

At the moment, there isn't. I could look into adding it, though. Could you file a big report with that information at launchpad? Thanks!
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby plaristote » Sun May 20, 2012 7:57 am

Potato.
plaristote
 
Posts: 113
Joined: Sat May 12, 2012 2:02 pm

Postby texugo » Wed Jun 13, 2012 6:26 pm

hello fellows

I´m studying libRocket´s tutorial Dragging : http://librocket.com/wiki/documentation/tutorials/Dragging

Everything goes right but when i set icon drag property to clone in tutorial.rss the app run, but when i´m about to drag any icon my app simply crash :?

I´m on windows 7 and panda3d 1.8. Any ideas?
Thanx
User avatar
texugo
 
Posts: 228
Joined: Tue Jan 20, 2009 7:28 am
Location: Racconland

PreviousNext

Return to Panda Features in Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron