Horde3D
http://www.horde3d.org/forums/

Python wrapper
http://www.horde3d.org/forums/viewtopic.php?f=1&t=313
Page 2 of 5

Author:  Codepoet [ 21.10.2008, 19:21 ]
Post subject:  Re: Python wrapper

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.

Author:  SpOOky [ 03.02.2009, 02:15 ]
Post subject:  Re: Python wrapper

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?

Author:  swiftcoder [ 03.02.2009, 02:19 ]
Post subject:  Re: Python wrapper

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.

Author:  SpOOky [ 03.02.2009, 03:29 ]
Post subject:  Re: Python wrapper

i meant the binding in a binary format (.pyd) :)

Author:  Codepoet [ 03.02.2009, 03:38 ]
Post subject:  Re: Python wrapper

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.

Author:  swiftcoder [ 03.02.2009, 05:20 ]
Post subject:  Re: Python wrapper

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?

Author:  SpOOky [ 03.02.2009, 12:02 ]
Post subject:  Re: Python wrapper

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 :)

Author:  Codepoet [ 03.02.2009, 15:23 ]
Post subject:  Re: Python wrapper

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?

Author:  SpOOky [ 03.02.2009, 15:55 ]
Post subject:  Re: Python wrapper

I have been trying to build them with mingw but got nowhere. Can they be built using msvc2008sp1?

Author:  Codepoet [ 03.02.2009, 16:07 ]
Post subject:  Re: Python wrapper

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.

Author:  SpOOky [ 03.02.2009, 16:13 ]
Post subject:  Re: Python wrapper

The ctypes soulutions sounds great. Not needing to build the library using a cpp compiler will make it more accessible IMHO. :)

Thank you

Author:  Codepoet [ 03.02.2009, 18:34 ]
Post subject:  Re: Python wrapper

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 676 times

Author:  SpOOky [ 03.02.2009, 19:22 ]
Post subject:  Re: Python wrapper

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

Author:  Codepoet [ 03.02.2009, 19:34 ]
Post subject:  Re: Python wrapper

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

Author:  SpOOky [ 03.02.2009, 21:45 ]
Post subject:  Re: Python wrapper

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

Page 2 of 5 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/