Crystal Space
Welcome, Guest. Please login or register.
July 31, 2014, 04:33:46 am

Login with username, password and session length
Search:     Advanced search
9005 Posts in 2043 Topics by 8262 Members
Latest Member: Emilymoore
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Python Bindings Issues
« previous next »
Pages: [1] Print
Author Topic: Python Bindings Issues  (Read 3238 times)
andygodwin
Newbie
*
Posts: 10


View Profile Email
« on: January 23, 2006, 09:43:07 pm »

Hi, everyone.

I've been wandering round the internet (it takes a while) looking at 3D engines for my latest project. Being a Python programmer, and not wanting to spend a month or two learning C/C++, my focus is mainly on the Python bindings of engines, and thus we come to CrystalSpace.

I checked out a copy of CVS and compiled it (well, I updated from CVS until it did compile, there were some changes going on it seems), and loaded up things like walktest and csdemo, which all seem to work well. I then proceeded to the CS python bindings directory, and loaded up tutorial0.py, and I get this error/traceback:

Code:
$ python tutorial3.py
SCF_WARNING: class crystalspace.collisiondetection.opcode (from /usr/lib/crystalspace/csopcode.so) has already been registered in the same context `crystalspace' (in /usr/lib/crystalspace/opcode.so)
WARNING: could not load plugin 'crystalspace.window.x.extf86vm'
Traceback (most recent call last):
  File "tutorial3.py", line 197, in ?
    if not csInitializer.SetupEventHandler(object_reg, EventHandler):
  File "/usr/share/crystalspace/bindings/python/cspace.py", line 13252, in _csInitializer_SetupEventHandler
    hdlr = _EventHandlerFuncWrapper(obj)
  File "/usr/share/crystalspace/bindings/python/cspace.py", line 13240, in __init__
    csPyEventHandler.__init__(self)
  File "/usr/share/crystalspace/bindings/python/cspace.py", line 13236, in __init__
    _csPyEventHandler.__init__(self, self)
TypeError: __init__() takes exactly 1 argument (2 given)

This has been occurring in CVS builds since at least two days ago, and since there seems to be no mention of it I'm guessing it's either specific to my computer (OS = Ubuntu 5.10), a new bug, or not many people use the CS python bindings. I've dug around in the binding file (cspace.py), and tried reducing the number of arguments passed to _csPyEventHandler.__init__ to just one, and then another error comes up telling me that _csPyEventHandler has no constructor (the error is written into the code, so I assume it is due to how the bindings are made/translated/whatever).

I tried the pseudo-stable builds, which fail on a different error, but these say below them that they don't work with Python anyway.

Any ideas what this is? Should I go file a bug report? I've had a look at other engines, but OGRE lacks some features, such as portals, and Soya3D isn't exactly great under high load, so it would be great if I could get CS working.
Logged
rhohr
Newbie
*
Posts: 6


View Profile
« Reply #1 on: January 24, 2006, 04:18:40 pm »

Hello:

I'm exactly in the same situation.

It seems to be a known issue, take a look:

http://sourceforge.net/mailarchive/message.php?msg_id=14191718

Maybe someone can briefly explain the problem and we can try to solve it (but I think it's not as simple)

Greetings,
rhohr

PD. Sorry for my english...
Logged
andygodwin
Newbie
*
Posts: 10


View Profile Email
« Reply #2 on: January 24, 2006, 05:08:16 pm »

You're right, it seems as though this is a known problem...

I might try and check out what is supposed to be a 'working' version of the CVS and see if I can get that to compile. Apart from that, I think it's a case of waiting for a fix; I'd love to be able to try it but the code is pretty complex and I have very little real knowledge of C++ past the grammar.
Logged
andygodwin
Newbie
*
Posts: 10


View Profile Email
« Reply #3 on: January 25, 2006, 12:18:33 pm »

Hmm, I have a copy of CrystalSpace from 6th December running - it seems that there was a massive overhaul to the event handling system on the 7th december, and some parts, such as the Python bindings, seem not to be fully working yet.

Personally, since I'm going to write a more pythonic wrapper around CrystalSpace, I reckon I can just write most of the code with this older, and working, version, and then just update the wrapper to blend more nicely around the new event system. It seems there are some new things, however:

Quote
7-Dec-2005
   - Adam Bradley checked in a massive event system overhaul.
       - The pre-overhaul code is tagged as PRE_EVENT_OVERHAUL_2005
       - Replace constant event types/masks with string event names.
       - Add constraint-driven event subscription and scheduling
       - Change event handler interface to define its own event
         delivery constraints
       - Change all input, axis, and button enumerations from
         basis-1 to basis-0
Logged
rhohr
Newbie
*
Posts: 6


View Profile
« Reply #4 on: January 25, 2006, 06:55:21 pm »

Thanks for the research!

I'm downloading from CVS with this command:

cvs -Q -d:pserver:anonymous@cvs.crystalspace3d.org:/cvsroot/crystal checkout -D "6/12/2005" -P CS
(similar format as in CS/bin/snapshot.py)

Any other place to get a compressed archive?

Also, I'll take a deep look into
http://sourceforge.net/mailarchive/forum.php?forum_id=33104&max_rows=25&style=flat&viewmonth=200512&viewday=7

to try to understand what changes are nedded.

Any other information from anyone is welcome.

Thanks!

PD: Sorry my english
Logged
rhohr
Newbie
*
Posts: 6


View Profile
« Reply #5 on: January 26, 2006, 01:15:54 pm »

Hello again,

Even though it's easy to find (just for the record) ...

Here's direct info from the creator of the new event system, including the patch:

http://cs-people.bu.edu/artdodge/linux/crystalspace/eventsystem/

Greetings,
rhohr.-
Logged
rhohr
Newbie
*
Posts: 6


View Profile
« Reply #6 on: February 20, 2006, 07:02:08 pm »

  Hello again.

  After some days working in this issue, caedes and me are close to solve this. Stay tuned..

  BTW, andygodwin.. are you still insterested in that pythonic wrapper?

Greetings,
rhohr.-
Logged
andygodwin
Newbie
*
Posts: 10


View Profile Email
« Reply #7 on: February 20, 2006, 07:24:56 pm »

Great! Yes, I did write a sort-of-working wrapper (I'm trying to make the task of CS usage in Python a little easier for myself), which I am improving upon, although I think I'm going to have to rewrite at some point know I've learnt more about how CS works.
Logged
rhohr
Newbie
*
Posts: 6


View Profile
« Reply #8 on: February 24, 2006, 06:26:44 pm »

As you can see here
http://community.crystalspace3d.org/forum/index.php/topic,870.0.html

the changes are commited.. enjoy!

Grettings,
rhohr.-

PD: about the pythonic wrapper we'll talk... ;)
Logged
andygodwin
Newbie
*
Posts: 10


View Profile Email
« Reply #9 on: February 24, 2006, 07:15:01 pm »

Excellent. I'll update my CVS in a few hours and see what I get.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.353 seconds with 15 queries.