Horde3D

Next-Generation Graphics Engine
It is currently 29.03.2024, 16:03

All times are UTC + 1 hour




Post new topic Reply to topic  [ 75 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Python wrapper
PostPosted: 21.10.2008, 19:21 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
I can't find any problems which would result in a segfault.
Which version of pyglet are you using? And are you really sure you got the right version installed? The __init__.py in Beta2 should not emit anything related to primitives (one of my local extensions).

A new version of the Beta 2 bindings are available.


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 02:15 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
Hi, these bindings might be just what i am looking for to speed up development. Nice work!

What's the status on them? Can you provide the latest version in binary format?

_________________
Paul


Last edited by SpOOky on 03.02.2009, 02:26, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 02:19 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
SpOOky wrote:
Can you provide the latest version in binary format?
I always wonder why anyone wants a binary of a python script - easier to deal with a script and py2exe it after, IMHO :)

The latest version is in SVN, I believe.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 03:29 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
i meant the binding in a binary format (.pyd) :)

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 03:38 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
The Python bindings should work with the community version of Horde3D as in the svn repo at time of the commit. They should work with svn HEAD too, if not it should be a very small fix.

@SpOOky: For what operating system / programming environment do you need binaries?

@swiftcoder: my bindings are not pure Python - they contain .cpp files.


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 05:20 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
Codepoet wrote:
@swiftcoder: my bindings are not pure Python - they contain .cpp files.
TBH, I haven't looked at your bindings, but what does this provide beyond what a straight ctypes-wrapper would?

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 12:02 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
I need them for windows/python 2.5.4(x86)

I'm using Windows7 x64, but this shouldn't be a problem as the binaries you've posted here work with it.

Thanks :)

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 15:23 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
The advantage of the C / C++ wrappers is that I can use enum values directly and must not maintain them in the Python code. But I'll take a look at ctypes to avoid the issues with binaries.

I've updated the wrappers for community svn HEAD and my knight sample runs again. If something else is missing, please post it here.

Regarding the binaries: I'll try to create Win32 binaries, but that might take some time since I don't have a Windows environment, only mingw. But have you tried compiling it yourself?


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 15:55 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
I have been trying to build them with mingw but got nowhere. Can they be built using msvc2008sp1?

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 16:07 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
In theory yes. Have you searched for a howto? I've never used VS to build the windows binaries.

If you give me a few days I'll have a basic ctypes wrapper to avoid this problem.


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 16:13 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
The ctypes soulutions sounds great. Not needing to build the library using a cpp compiler will make it more accessible IMHO. :)

Thank you

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 18:34 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
I've attached a preview version which misses much of the functionality but can run the knight sample. Could you try it? I can't test whether I got the DLL loading on windows right. If it does not work search for lines containing "LoadLibrary" and change them.


Attachments:
File comment: Preview of Horde3D Python bindings implemented using ctypes for svn r190
Python-ctypes.zip [9.12 KiB]
Downloaded 665 times
Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 19:22 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
After fiddling with the LoadLibrary code the Knight sample starts.

The particles do not show up. I believe that this is relevant from the engine log.

Code:
Adding nodes from SceneGraph resource 'knight.scene.xml'
2.977   Invalid parent node handle 0 in addNodes
2.977   Invalid node handle 0 in setNodeTransform
2.977   Adding Light node 'Light1'
2.977   Adding Camera node 'cam 44080176'
2.988   Invalid node handle 0 in findNodes


then continuing with 100 or so of the last line

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 19:34 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
Could you post the LoadLibrary code for Windows?

I found the problem:
search for "class SceneNodeTypes" and fix the IDs. it must read:
Code:
class SceneNodeTypes(object):
    Undefined = 0
    Group = 1
    Model = 2
    Mesh = 3
    Joint = 4
    Light = 5
    Camera = 6
    Emitter = 7


Top
 Profile  
Reply with quote  
 Post subject: Re: Python wrapper
PostPosted: 03.02.2009, 21:45 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
In the end I've just added ".dll" in:
"except OSError:
h3d = cdll.LoadLibrary('Horde3D.dll')"

After the edits to SceneNodeTypes the app crashes:
Code:
Traceback (most recent call last):
  File "C:\Users\paul\Desktop\knight.py", line 23, in <module>
    import horde3d as h3d
  File "C:\Python25\lib\site-packages\horde3d\__init__.py", line 3

    import utils
  File "C:\Python25\lib\site-packages\horde3d\utils.py", line 39,
    h3dutils = cdll.LoadLibrary('Horde3DUtils.dll')
  File "C:\Python25\lib\ctypes\__init__.py", line 431, in LoadLibr
    return self._dlltype(name)
  File "C:\Python25\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

_________________
Paul


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 75 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group