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 1 - Line: 866 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_parser.php 866 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key 1 - Line: 885 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_parser.php 885 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
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 1 - Line: 866 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_parser.php 866 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key 1 - Line: 885 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_parser.php 885 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
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


PyGTK track editor idea - thelusiv - 02-07-2007

I've been doing some PyGTK programming lately, and I've found it's fairly easy to set up a pretty good GUI using it with Glade to design the interfaces. It is pretty fast and ports to OS X and Windows very easily. There are bindings for Python to OpenGL as well as SDL, PyOpenGL and PyGame respectively. How's that for link saturation? Smile

So what I propose is to set up a GUI around a sort of viewport that will basically have inside it the track editor we already have. The gui would have lots of buttons to do things easily, like for instance add objects, move and edit them, set track parameters, export tracks to in-game readable format, etc.

The "viewport" code could either consist of the C++ code we have for the track editor now, converted to Python, or it could be set up as an external C++ library that is used by Python. Python has bindings for lots of languages so this shouldn't be too hard. However it might make the code a little more managable to just convert to Python.

Farther down the road we could probably even write code to generate road models based on user-input dimensions, and perhaps even import them directly into the editor. Perhaps we could get some ideas on how to do this from the Java-based open source TORCS track editor that generates roads.

So, what do you guys think about Python and GTK? To me, the biggest advantage for Python is how easy it is to develop things quickly, and for GTK it's the cross-platform interface designer (Glade).


- cotharyus - 02-07-2007

I'd say, based on the current situation with tracks, and the editor, that you've got something vastly superior to what we currently have in mind. I'd be interested in seeing how it turns out. It's been said many times that our tracks are our greatest weakness.


- joevenzon - 02-07-2007

Sounds like a great idea. Also, although I'm not sure how much it'll help, it's nice that python is also used for all of the blender import/export scripts. I'm somewhat familiar with python (whitespace as a token? what were they thinking...) so I can help get you up to speed if you're not.


- reece146 - 02-07-2007

I say go for it.

At this stage it is more important to have a user friendly tool prototyped and workable for users than going back to first principles and coding something from scratch in C/C++.


- thelusiv - 02-07-2007

OK, I will see what I can whip up in terms of basic gui and Python code to go with it. Hopefully others will be able to pick up on it and add things. I thought Python would be a good language to go with since, as Joe said, we use it for Blender export scripts. Also, our build system, SCons, is all written in Python (and its SConscript files are also all Python). So, the more Python knowledge our team has, the better, I say...

Joe, when you mention using whitespace as a token, are you talking about how Python assumes code block nesting from indentation? At first this seems confusing to most people with C/C++ backgrounds but really it makes things way easier in the end. Not having to worry about the curly braces and what not is very nice. You just have to remember to be consistent. Personally, I do two spaces for indentation in Python.

I might get something set up tonight, it will be very basic though. And yeah reece146, this tool could be viewed as a prototype that could then be rewritten in C++ later, or if it works well enough, it could just be used as the finished product.


- reece146 - 02-07-2007

thelusiv Wrote:And yeah reece146, this tool could be viewed as a prototype that could then be rewritten in C++ later, or if it works well enough, it could just be used as the finished product.

Yep, these days computers have so much power it doesn't matter if the coding language underlying a tool is not C or whatever since the CPU can power through most things, particularly if it is a non-real-time type app running on a single user box.

Value add per user benefit and all that.


- thelusiv - 02-07-2007

I'm working on setting up a basic Glade interface now. Also I found GtkGLExt which is an OpenGL extension for GTK. The Python binding for it is PyGtkGLExt which is available from the link above.


- joevenzon - 02-07-2007

Quote:are you talking about how Python assumes code block nesting from indentation? At first this seems confusing to most people with C/C++ backgrounds but really it makes things way easier in the end. Not having to worry about the curly braces and what not is very nice

Yep, that's what I'm talking about. Bugs the hell out of me. Have you ever tried copying & pasting code from one project to another, or from some website? What a pain....


- thelusiv - 02-07-2007

Heh yeah, but you know me, I am really picky about indentation and whitespace anyway, so it doesn't bother me much Wink

I just checked something in to the vdrift-trackeditor repository.

To check it out:
Code:
svn co http://svn.vdrift.net/repos/vdrift-trackeditor/branches/pygtk-trackeditor vdrift-track-editor

It doesn't actually do anything yet. It's just a mockup in glade and a framework for a program. It starts up and quits. It has a few functionless buttons. More to come...


- thelusiv - 02-08-2007

To use what I added you'll need to install the following: python 2.4, gtk 2.8+, pygtk, libglade, libgtkglext, and pygtkglext. I haven't actually added the GL stuff yet but go ahead and get it. Wink

Ubuntu 6.10: download the package python-gtkglext1_1.1.0-1_i386.deb from here, then
sudo apt-get install python2.4 python-gtk2 python-glade2 python-opengl libgtkglext1
sudo dpkg -i python-gtkglext1_1.1.0-1_i386.deb

On Gentoo, I'm not sure what the python GTK and Glade packages are called but you can get pygtkglext thus:
emerge pygtkglext


- reece146 - 02-08-2007

thelusiv Wrote:On Gentoo, I'm not sure what the python GTK and Glade packages are called

emerge -avt gtk+ libglade pygtkglext


- thelusiv - 02-08-2007

Thanks for filling in that blank for me reece146 Smile

I've made a few more updates. I added some simple icons and an About dialog. The program now properly checks for all the libs it will need. Quitting was broken before, fixed now. I've started playing with Glade 3 and it's great! If you're still using Glade 2, I strongly suggest an upgrade (also, Anjuta 2 has Glade 3 built in, but I'm not sure how good the support is yet).

I've also started looking at GLChess, a simple PyGTK + OpenGL chess game. It's the best example I can find for using the Python 3D libraries.

By the way, PyGtkGLExt only provides the interface between GTK and GL, you still have to have PyOpenGL to do the actual OpenGL stuff. I didn't realize this before, Fortunately though most OpenGL calls are the same in Python as they are in C/C++, so it should be pretty easy to port our track/model load/display code to Python.


- rookie1 - 04-20-2007

I'm experimenting with Boost.Python to wrap the existing c++ codes. Already successfully loaded the track data using the wrapped OBJECTS class in Python. Now trying to display the track in the new Python track editor. Will update you once the display works. Smile


- rookie1 - 04-20-2007

Well, I can't get the display to work. I've wrapped all the necessary functions. Not sure where is the problem. Sad Can I upload my changes to svn so others can take a look?


- thelusiv - 04-20-2007

Yes go right ahead, I'd love to take a look at it. Thanks for your work on this!