The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 573 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 752 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(257) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/printthread.php(257) : eval()'d code 2 errorHandler->error
/printthread.php 257 eval
/printthread.php 117 printthread_multipage
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Forums
PyGTK track editor idea - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Community (https://www.vdrift.net/Forum/forumdisplay.php?fid=3)
+--- Forum: Cars & Tracks (https://www.vdrift.net/Forum/forumdisplay.php?fid=11)
+--- Thread: PyGTK track editor idea (/showthread.php?tid=517)

Pages: 1 2 3


- rookie1 - 04-22-2007

Commited into the pygtk track editor branch. You need to use scons to build the export module vdrift.so. This module is imported into Python in vdrift-track-editor.py.

The Boost.Python wrapping is done in src/wrapper.cpp.


- thelusiv - 04-25-2007

I still haven't had a chance to look at this yet, I've been very busy...could you be more specific with what I need to do with SCons? Would it be obvious if I actually looked at it? Smile


- rookie1 - 04-27-2007

Well, just type 'scons' at the pygtk-trackeditor directory to build the export module vdrift.so. Smile After that, you can start the track editor Python script as you used to.

The scons script is a very simple one. You can certainly look at it if you want.


- thelusiv - 04-29-2007

Did you add some new libraries? I tried it out and got it to compile after installing boost, but now the program won't run, I get:

Code:
There was a problem including a library.
Traceback (most recent call last):
  File "vdrift-track-editor.py", line 78, in <module>
    class VDriftTrackWindow  (GLScene, GLSceneButton, GLSceneButtonMotion):
NameError: name 'GLScene' is not defined
I'm not sure where those come from and searching around in Synaptic and installing things is not getting me anywhere...what should I install? Do I need to download it from somewhere? I'm running Ubuntu Feisty...


- rookie1 - 04-29-2007

GLScene is defined in gtk.gtkgl.apputils, which is part of python-gtkglext1. Did you install this package?


- rookie1 - 04-30-2007

I've made some progress today (r53). Track geometry is displayed in the 3D window. You can drag the mouse to move camera around the scene. Seems texture mapping and lighting are not working. Just black shapes.


- joevenzon - 04-30-2007

Just some general comments (trying to be helpful): lighting and textures have a lot to do with the opengl state. If you're basing the editor code on the game code, beware that the opengl state is poorly managed, so you might want to either 1) tear out the opengl state stuff and replace it with simpler code, if you don't need to be fancy (enable lighting, enable texturing, done) or 2) integrate the new scenegraph code i'm planning on adding in a week or two (it's my highest priority project at the moment) which will clean up and consolidate all of the opengl state management.


- rookie1 - 04-30-2007

In fact the opengl init code is done in python, instead of using the existing function in main.cpp. The code for enabling lighting and texture are already present. Not sure why it's not working. Must be something i've missed.


- rookie1 - 05-01-2007

Upon further investigation, texture mapping seems to work. When i move the camera close to ground, the ground texture is visible but very dark. Looks like lighting is the problem.

This is a screen shot of Ruudskogen.
[Image: 0_trackeditor1.png]


- rookie1 - 05-03-2007

Finally, the track is displayed correctly. The problem turns out to be a call to enable GL_FOG in OBJECTS:Big Grinraw(). After comment out this line, the display works. :lol: I've attached a screenshot of Laguna Seca at the end.

Now something to discuss, if you look at the pygtk-trackeditor directory, I've copied the required source files and include files from vdrift and made some modifications for the compilation to be successful. We will run into out-of-sync problems sooner or later between pygtk-trackeditor and vdrift mainline code.

To solve this problem, I've modified vdrift scons scripts to add another target called 'wrapper'. This will build an export module (shared library) called vdrift.so in vdrift build directory. To run the pygtk-trackeditor, simply copy this file to the track editor directory.

There are minimal changes to vdrift mainline code,
1. scons script change to add new target
2. add a wrapper.cpp in src/
3. couple of conditional compilation in objects.cpp (e.g. do not call glEnable(GL_FOG) if we are building the wrapper)

So, what do you say? Can I commit the changes to vdrift mainline?

Now for the screen shot
[Image: 3_trackeditor2.png]


- protomor - 05-03-2007

omfg whens this going to be done! or at least a doable beta?


- thelusiv - 05-04-2007

protomor, we'd like it to be done as soon as possible, of course. Hopefully it will be somewhat functional some time before we do the next VDrift release.

rookie1, the screenshot looks fantastic, thanks for your work on this! Also, I can't see why the changes you propose to make to trunk will have any adverse effects. Do you know of any problems these changes will trigger? If not, I think you can go ahead and commit.


--------------
The following is not really related to VDrift, but more about my problems trying to get pygtkglext working on Ubuntu Feisty 64. The reason I'm posting the info is for others who might be having the same problem and maybe this will help someone find a solution. If you wish to save time and skip it, just start reading again after the next dashed line....


I finally got around to trying this out tonight, since I'm finally done with exams. Big Grin Unfortunately I couldn't get it to work on my development machine. It's running Ubuntu Feisty for AMD64, and there was no package for it available. I tried the amd64 .deb from Debian unstable, but it wouldn't work (complained that I didn't have python package version 2.4).

So of course I headed over to the GtkGlExt home page and picked up the latest source package for pygtkglext. Running setup.py didn't work for me, even with python2.4:
Code:
thelusiv@deuxeau:~/code/pygtkglext-1.1.0$ python2.4 setup.py install --prefix=/usr
Traceback (most recent call last):
  File "setup.py", line 89, in ?
    if not pkgc_version_check('pygtk-2.0', 'PyGTK', PYGTK_REQUIRED_VERSION):
TypeError: pkgc_version_check() takes exactly 2 arguments (3 given)
Since the middle argument on line 89 looked the most useless, I deleted it and tried again:
Code:
thelusiv@deuxeau:~/code/pygtkglext-1.1.0$ python2.4 setup.py install --prefix=/usr
Traceback (most recent call last):
  File "setup.py", line 118, in ?
    override='gtk/gdkgl/gdkglext.override')
  File "/var/lib/python-support/python2.4/gtk-2.0/dsextras.py", line 418, in __init__
    py_ssize_t_clean))
  File "/var/lib/python-support/python2.4/gtk-2.0/dsextras.py", line 328, in __new__
    raise NameError("'%s' is not defined\n" % cls.__name__
NameError: 'Template' is not defined

***************************************************************************
Codegen could not be found on your system and is required by the
dsextras.Template and dsextras.TemplateExtension classes. codegen is part
of PyGTK. To use either Template or TemplateExtension, you should also
install PyGTK.
***************************************************************************

OK, so that's not going to work. Giving up on setup.py I see there is an autotools setup too, so I run ./configure --prefix=/usr and it works, as does make and sudo make install. This installed files that looked like the ones I needed to /usr/lib/python2.5/site-packages/gtk-2.0/gtk/gtkgl . Now I'm getting somewhere...but sadly it still doesn't work. Trying to import the library by all different names, I finally moved the gtkgl directory down to /usr/lib/python2.5/site-packages/ and tried:
Code:
thelusiv@deuxeau:~/code/vdrift-trackeditor/branches/pygtk-trackeditor$ python
Python 2.5.1 (r251:54863, May  2 2007, 16:27:44)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtkgl
Segmentation fault (core dumped)
Ouch! :o

Giving up on python 2.5, I move the directory to /usr/lib/python2.4/site-packages and try:
Code:
thelusiv@deuxeau:~/code/vdrift-trackeditor/branches/pygtk-trackeditor$ python2.4
Python 2.4.4 (#2, Apr 12 2007, 21:22:23)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gtkgl.apputils import *
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/gtk-2.0/gtkgl/__init__.py", line 21, in ?
    from _gtkgl import *
ImportError: /usr/lib/python2.4/site-packages/gtk-2.0/gtkgl/_gtkgl.so: undefined symbol: Py_InitModule4_64
So, in short, it seems that pygtkglext has some issues on the latest Ubuntu release, at the very least it needs to be packaged properly, at most it could need updates to run correctly. It seems that at least part of the problem could be related to 64 bit systems.

-----------------



So, back to my old 32-bit development machine running Ubuntu Edgy which has a package for pygtkglext, it runs fine. I am trying to stop using that computer, but damn it, it's so useful.

Now that I actually got it running I have started playing around with the code and made a few changes. I didn't find it very easy to move around the way the camera controls were set up. The changes I made are detailed in the commit log message. rookie1, let me know if you don't like any of the changes I made.

An issue introduced by my changes is that now the user can't control camera up/down movement. I think the best way to address this would be to make the camera always float a certain distance above the track and other objects beneath it. I think I can get this information from the track objects that have been loaded, but haven't tried this yet. Joe, or anyone else who might know how to do this, feel free to chime in. I'll probably work on this a little more tomorrow and over the weekend.

Another thing that is pretty important is the ability to select objects by clicking on them. I'd like to get this working as well. We'll also need to set up a similar way to select objects' vertices so that the track surface can be defined. Left mouse click would probably work great for both of these, with a menu/toolbar toggle to switch between vertex/object selection mode.

There's a lot more stuff I have in mind but this post is already long and I'm tired, so more later. Anyway, great work rookie1, this track editor is now officially off to a good start. Smile :mrgreen:


- rookie1 - 05-04-2007

I've committed the changes to vdrift and pygtk-trackeditor. I've added a README file in pygtk-trackeditor to give instructions on how to use it.

Some changes i've made
- now you need to click open button to load a track. the editor do not auto load the default track any more.
- all the track objects are listed at the left pane.

I've no problem with the mouse control change. In fact it was added mainly to help me debug the display problem. So it has not been properly planed out. Just a suggestion, maybe we can use Ctrl-mouse drag to move up/down?


- joevenzon - 05-04-2007

To find the height of the track at a given position, use TRACK::Elevation(VERTEX origin)

Do do mouse picking of objects you'll need the following function:
bool OBJECTS::Collide(VERTEX origin, VERTEX direction, VERTEX &outtri, bool closest, VERTEX & normal, float seglen, OBJECTNODE * &colnode);

You give that function a ray segment (origin plus a normalized direction vector plus the ray length seglen), and you get back a collision point VERTEX (outtri), the normal of the collision point (normal), and a pointer to the OBJECTNODE (colnode) which is the object class. You can set closest to whatever works. It's supposed to toggle whether or not you get the closest collision or don't care, but I don't remember if it's working or not. Just use whatever value works.


- thelusiv - 05-05-2007

rookie1, your changes work OK for me. I just build the vdrift wrapper with "scons wrapper" and copy the .so file (or symlink it Smile ).

I've checked in some improvements to the open track dialog. It now uses the FileChooserDialog instead of the FileSelection widget, and only allows selection of folders. Also I hooked up the File -> Open menu entry. There were also a few bugs with the track window trying to display when a track was not loaded, which I fixed.