Modified Track Path Editor + Tracks/Discussion

Could I get some help here? I can't figure out for the life of me how to install pillow and numpy required for tarnheld's TED editor. Not even youtube tutorials can help me out. :lol:
I'm using Python 3.4, I've downloaded the correct versions of numpy and pillow (I believe) and both are WHL files.
In case it wasn't obvious, I have zero knowledge about Python. :)
 
Could I get some help here? I can't figure out for the life of me how to install pillow and numpy required for tarnheld's TED editor. Not even youtube tutorials can help me out. :lol:
I'm using Python 3.4, I've downloaded the correct versions of numpy and pillow (I believe) and both are WHL files.
In case it wasn't obvious, I have zero knowledge about Python. :)

Have you tried double-clicking the pipinstall.bat file that comes with the editor? If it fails, can you send me the error that pops up?

Python has an installer for 3rdparty libraries, it's called pip, so you don't need to download and install the whl files of the library packages usually. The pipinstall.bat calls that installer for all requirements. But if it doesn't work for you, i'll be glad to help.
 
Have you tried double-clicking the pipinstall.bat file that comes with the editor? If it fails, can you send me the error that pops up?

Python has an installer for 3rdparty libraries, it's called pip, so you don't need to download and install the whl files of the library packages usually. The pipinstall.bat calls that installer for all requirements. But if it doesn't work for you, i'll be glad to help.
Yes, I did! Well, pipinstall.bat would just immediately close after opening it. TedEditor.bat told me python 3 couldn't be found, so I tried making the pythonenv.bat as it recommended (by writing the lines it said on a notepad then saving it as a .bat).
That didn't work either, both tededitor and pipinstall would close immediately too.
So I made a PATH environment variable that directed to Python's installation path as I had seen on a vid (also I deleted pythonenv.bat). So now pipinstall.bat works, it downloaded and installed both numpy and pillow but towards the end it gave me an error which I didn't have time to read either. It was written in yellow, then red.
Then I started up tededitor.bat. Another error which says:
File "ted-editor.py", line 1065
cids=[self.canvas.create_polygon(poly, **self.movestyle, tags=self.movetag),

SyntaxError: invalid syntax
And to top it off, below it still said python version 3 could not be found yada yada yada. :lol:

P.S. I'm on 32-bit if that explains anything.
 
Yes, I did! Well, pipinstall.bat would just immediately close after opening it. TedEditor.bat told me python 3 couldn't be found, so I tried making the pythonenv.bat as it recommended (by writing the lines it said on a notepad then saving it as a .bat).
That didn't work either, both tededitor and pipinstall would close immediately too.
So I made a PATH environment variable that directed to Python's installation path as I had seen on a vid (also I deleted pythonenv.bat). So now pipinstall.bat works, it downloaded and installed both numpy and pillow but towards the end it gave me an error which I didn't have time to read either. It was written in yellow, then red.
Then I started up tededitor.bat. Another error which says:
File "ted-editor.py", line 1065
cids=[self.canvas.create_polygon(poly, **self.movestyle, tags=self.movetag),

SyntaxError: invalid syntax
And to top it off, below it still said python version 3 could not be found yada yada yada. :lol:

P.S. I'm on 32-bit if that explains anything.

So, the requirements were already installed, but you ran into a feature that is not supported in Python 3.4 that i use in the ted-editor. You have to download the latest Python version. Then you have to run pipinstall.bat once again to install the requirements for the new version (if all goes well it will close, else it will stay open.) Then you can try to start the ted editor by running TedEditor.bat. Hope this helps. 👍
 
Yes, I did! Well, pipinstall.bat would just immediately close after opening it. TedEditor.bat told me python 3 couldn't be found, so I tried making the pythonenv.bat as it recommended (by writing the lines it said on a notepad then saving it as a .bat).
That didn't work either, both tededitor and pipinstall would close immediately too.
So I made a PATH environment variable that directed to Python's installation path as I had seen on a vid (also I deleted pythonenv.bat). So now pipinstall.bat works, it downloaded and installed both numpy and pillow but towards the end it gave me an error which I didn't have time to read either. It was written in yellow, then red.
Then I started up tededitor.bat. Another error which says:
File "ted-editor.py", line 1065
cids=[self.canvas.create_polygon(poly, **self.movestyle, tags=self.movetag),

SyntaxError: invalid syntax
And to top it off, below it still said python version 3 could not be found yada yada yada. :lol:

P.S. I'm on 32-bit if that explains anything.
Changed to Python 3.6 and now I gett the same as you :(....
 
So, the requirements were already installed, but you ran into a feature that is not supported in Python 3.4 that i use in the ted-editor. You have to download the latest Python version. Then you have to run pipinstall.bat once again to install the requirements for the new version (if all goes well it will close, else it will stay open.) Then you can try to start the ted editor by running TedEditor.bat. Hope this helps. 👍

I'll try that then, Thank You :D
 
Thank you! I'll have to see if maybe I can get it to work on the home's desktop (no admin privileges for me there).
My laptop is old as hell and Python 3.4 is the last one available for XP unfortunately.
 
Im on the latest python, 3.5.2 is what it says & it's all good my end. I did have a little problem installing 1st before but @tarnheld helped me out regarding copying the full path & executing it within the cmd box. Or something like that, it may help. Windows 10 64bit. Python amd64.
 
Im on the latest python, 3.5.2 is what it says & it's all good my end. I did have a little problem installing 1st before but @tarnheld helped me out regarding copying the full path & executing it within the cmd box. Or something like that, it may help. Windows 10 64bit. Python amd64.
Might go back to that, was all cushty till I went and changed it :grumpy:
 
A problem with python 3.6 (and also 3.4 unfortunately) is the Pillow library: there is no precompiled binary package available, so the installer tries to build it form scratch, but this fails if you don't have a C/C++ compiler and some other stuff on your system (yes, some python libraries have parts written in C/C++... :eek::)).
 
A problem with python 3.6 (and also 3.4 unfortunately) is the Pillow library: there is no precompiled binary package available, so the installer tries to build it form scratch, but this fails if you don't have a C/C++ compiler and some other stuff on your system (yes, some python libraries have parts written in C/C++... :eek::)).
So you're saying it may be possible to get your editor to work on 3.4 if I have "a C/C++ compiler and some other stuff on my system"?
I figure it must still be easier to just try to install python on my desktop.
 
So you're saying it may be possible to get your editor to work on 3.4 if I have "a C/C++ compiler and some other stuff on my system"?
I figure it must still be easier to just try to install python on my desktop.

I added some changes to make it work with Python 3.4.4 (downloadable here), please download the ted-editor again. And i found a windows installer of the python 3.4 version of pillow here, download and double click to install (numpy should be installed already).
Hope this helps!
iu
 
I added some changes to make it work with Python 3.4.4 (downloadable here), please download the ted-editor again. And i found a windows installer of the python 3.4 version of pillow here, download and double click to install (numpy should be installed already).
Hope this helps!
iu
Words cannot express how thankful I am. But cookies sure can!


On a side note, the pillow installer you linked named the folder "pil", which was giving me constant errors saying there was no "PIL" module. I thought the upper cases wouldn't be a problem so only after trying different things did I decide to rename the folder "pil" to "PIL" and only then it started working. Not cool Python, you picky mofo.
Just thought I'd say this in case it's happening to anyone else here.
 
Hmm, got a predicament with my Ahvenisto track. If I want to replicate it 100% then the pits are located around the 1st corner after the main S/F straight.
Now the problem is I can have the S/F in the correct place & the pit lane in it's correct place but then the pits don't work :(
So do I A: move the start line to the pit location or
B: move the pit location to the start line.

Edit: forget option B as the pit lane would have bend around a corner so that won't work, **** it I'll have to do option A.

Edit again: Sorry guy's I'm babbling :)
 
Last edited:
Here's a small but quite useful update.

Changes in 1.0.9:
  • Undo / Redo functions have been added. Perfect if you mess up a transformation and don't want to start over from scratch. You can access these functions from the Edit menu, or by pressing ctrl + z (undo) or ctrl + x (redo). Currently there is no limit to how far back the history is saved, so let me know if you experience any performance issues with this.
Edit: 1.0.9a:
  • Fixed a problem where ctrl + z / ctrl + x would perform the undo / redo operation twice.
 

Attachments

  • elevation editor 1.0.9a.zip
    12.1 KB · Views: 16
Last edited:
@eran0004

Looking good :)

But the shortcuts do the function twice? Pressing Ctrl + Z will revert two changes while using the menustrip will revert once like I guess it should. Also, I would probably use Ctrl + Z for revert and Ctrl + Y for redo, like they are in most programs :).
 
Here's a small but quite useful update.

Aaannd it's included in the ted-editor now. :cheers:

Also, I would probably use Ctrl + Z for revert and Ctrl + Y for redo, like they are in most programs :).
Good point, i currently have Ctrl+r for redo. :dunce: Excuse my sloppy knowledge of "normal" key bindings, if it would go by me, we'd be using Ctrl+y for yanking and Ctrl+_ for undoing, if you know what i mean... ;)
 
Good point, i currently have Ctrl+r for redo. :dunce: Excuse my sloppy knowledge of "normal" key bindings, if it would go by me, we'd be using Ctrl+y for yanking and Ctrl+_ for undoing, if you know what i mean... ;)

For me the Z and Y are like the first things I'll test since I've been using them so much with for example Visual Studio and Photoshop. Even though I read they are Z and X, I still mistakenly pressed Y instead :D.
 
But the shortcuts do the function twice? Pressing Ctrl + Z will revert two changes while using the menustrip will revert once like I guess it should. Also, I would probably use Ctrl + Z for revert and Ctrl + Y for redo, like they are in most programs :).

Caused by an old keybind experiment that wasn't killed properly. Now it's fixed :D
 

Attachments

  • elevation editor 1.0.9a.zip
    12.1 KB · Views: 22
Small update of the ted-editor, added @eran0004's recent fixes and also a "Select All Control Points" function accessible through Ctrl-a. (Mmmh, maybe i should add menu entries for all the keyboard commands... 💡)

Also included is the long awaited "Scale to Length" feature, press the Key L and an ugly window pops up that allows to input a desired length and on pressing the Enter Key or the Ok button the selection is scaled to the new length. You have to select all control points first to scale the track, but that is easily done now with Ctrl-a. 👍
 
Many thanks to you guys for all the hard work, and @tarnheld for the help with the TED extraction. Had a bit of fun trying to get the global elevations right for this mashup of local road bits. Turned out pretty good !

https://www.gran-turismo.com/fr/gt6/user/#!/friend/GT-Alex74/course/2567680/

Few suggestions that would make things a bit more easy and save time for the user :

- show the start / finish line positions on the map
- show a minimap of the track in the elevation editor

Don't know if that's possible to do, but those are two features that would make the tool perfect ! ;)

Also, I went quite quickly through the topic, but does the editor allows for roadside object placement or do you have to edit it manually in the code directly ?
 
- show a minimap of the track in the elevation editor

Well, it's possible since all the data is in the file. The problem is that the data looks like this:

Code:
'cp': [
        {'FORM_TYPE': 0,
         'x': -105.62742614746094,
         'x2': 0.0,
         'y': -675.3032836914062,
         'y2': 0.0},
        {'FORM_TYPE': 0,
         'x': 318.63665771484375,
         'x2': 0.0,
         'y': -251.03919982910156,
         'y2': 0.0},
        {'FORM_TYPE': 2147483649,
         'x': 338.76837158203125,
         'x2': 255.9202423095703,
         'y': -219.9911346435547,
         'y2': -188.32278442382812},
        {'FORM_TYPE': 2147483650,
         'x': 343.965087890625,
         'x2': 256.7120666503906,
         'y': -198.82131958007812,
         'y2': -188.62545776367188},
        {'FORM_TYPE': 0,
         'x': 348.4624328613281,
         'x2': 0.0,
         'y': -160.3344268798828,
         'y2': 0.0},
        {'FORM_TYPE': 3,
         'x': 352.95977783203125,
         'x2': 0.0,
         'y': -121.8475341796875,
         'y2': 0.0},
        {'FORM_TYPE': 0,
         'x': 357.4571228027344,
         'x2': 0.0,
         'y': -83.36064147949219,
         'y2': 0.0},
        {'FORM_TYPE': 1,
         'x': 377.87054443359375,
         'x2': 424.8266906738281,
         'y': -42.28659439086914,
         'y2': -91.23304748535156},
        {'FORM_TYPE': 2,
         'x': 397.05072021484375,
         'x2': 424.2429504394531,
         'y': -29.40738868713379,
         'y2': -90.62455749511719},
        {'FORM_TYPE': 0,
         'x': 425.7906188964844,
         'x2': 0.0,
         'y': -16.641338348388672,
         'y2': 0.0},
        {'FORM_TYPE': 1,
         'x': 439.4756774902344,
         'x2': 454.1286315917969,
         'y': -12.185903549194336,
         'y2': -80.43802642822266},
        {'FORM_TYPE': 2,
         'x': 453.7835998535156,
         'x2': 454.1286315917969,
         'y': -10.631564140319824,
         'y2': -80.43802642822266},
        {'FORM_TYPE': 1,
         'x': 468.1061706542969,
         'x2': 454.1286315917969,
         'y': -12.044387817382812,
         'y2': -80.43802642822266},
        {'FORM_TYPE': 2,
         'x': 481.8346252441406,
         'x2': 454.1286315917969,
         'y': -16.364322662353516,
         'y2': -80.43802642822266},
        {'FORM_TYPE': 1,
         'x': 494.38543701171875,
         'x2': 454.1286315917969,
         'y': -23.407747268676758,
         'y2': -80.43802642822266},
        {'FORM_TYPE': 2,
         'x': 505.2250671386719,
         'x2': 454.1286315917969,
         'y': -32.875274658203125,
         'y2': -80.43802642822266},
        {'FORM_TYPE': 1,
         'x': 513.892822265625,
         'x2': 454.1286315917969,
         'y': -44.36448669433594,
         'y2': -80.43802642822266},
        {'FORM_TYPE': 2,
         'x': 520.0203247070312,
         'x2': 454.1286315917969,
         'y': -57.38702392578125,
         'y2': -80.43802642822266},
        {'FORM_TYPE': 1,
         'x': 523.2357788085938,
         'x2': 454.4337158203125,
         'y': -70.61942291259766,
         'y2': -80.331298828125},
        {'FORM_TYPE': 2,
         'x': 523.8086547851562,
         'x2': 454.4337158203125,
         'y': -84.22483825683594,
         'y2': -80.331298828125},
        {'FORM_TYPE': 1,
         'x': 521.7169799804688,
         'x2': 454.4337158203125,
         'y': -97.68070983886719,
         'y2': -80.331298828125},
        {'FORM_TYPE': 2,
         'x': 517.0411376953125,
         'x2': 454.4337158203125,
         'y': -110.47022247314453,
         'y2': -80.331298828125},
        {'FORM_TYPE': 1,
         'x': 509.3017578125,
         'x2': -34835.65625,
         'y': -126.5378189086914,
         'y2': 16908.1640625},
        {'FORM_TYPE': 2,
         'x': 501.5550842285156,
         'x2': -34835.65625,
         'y': -142.60189819335938,
         'y2': 16908.1640625},
        {'FORM_TYPE': 1,
         'x': 493.8011169433594,
         'x2': -34835.65625,
         'y': -158.66244506835938,
         'y2': 16908.1640625},
        {'FORM_TYPE': 2,
         'x': 486.0398254394531,
         'x2': -34835.65625,
         'y': -174.719482421875,
         'y2': 16908.1640625},
        {'FORM_TYPE': 1,
         'x': 470.4930419921875,
         'x2': -29945.494140625,
         'y': -206.82180786132812,
         'y2': 14543.1005859375},
        {'FORM_TYPE': 2,
         'x': 454.91241455078125,
         'x2': -29945.494140625,
         'y': -238.90771484375,
         'y2': 14543.1005859375},
        {'FORM_TYPE': 1,
         'x': 439.2154235839844,
         'x2': -43008.4609375,
         'y': -271.15936279296875,
         'y2': 20894.88671875},
        {'FORM_TYPE': 2,
         'x': 423.4945373535156,
         'x2': -43008.4609375,
         'y': -303.3993835449219,
         'y2': 20894.88671875},
        {'FORM_TYPE': 1,
         'x': 415.6251220703125,
         'x2': -43008.4609375,
         'y': -319.5149841308594,
         'y2': 20894.88671875},
        {'FORM_TYPE': 2,
         'x': 407.74969482421875,
         'x2': -43008.4609375,
         'y': -335.627685546875,
         'y2': 20894.88671875},
        {'FORM_TYPE': 1,
         'x': 399.8683166503906,
         'x2': -43008.4609375,
         'y': -351.73748779296875,
         'y2': 20894.88671875},
        {'FORM_TYPE': 2,
         'x': 391.98095703125,
         'x2': -43008.4609375,
         'y': -367.8443298339844,
         'y2': 20894.88671875},
        {'FORM_TYPE': 1,
         'x': 380.2049255371094,
         'x2': 316.6824035644531,
         'y': -385.6866455078125,
         'y2': -330.9540710449219},
        {'FORM_TYPE': 2,
         'x': 351.5659484863281,
         'x2': 316.2687072753906,
         'y': -407.257568359375,
         'y2': -330.5976257324219},
        {'FORM_TYPE': 0,
         'x': 315.7694396972656,
         'x2': 0.0,
         'y': -423.73968505859375,
         'y2': 0.0},
        {'FORM_TYPE': 2147483649,
         'x': 286.65521240234375,
         'x2': 351.43914794921875,
         'y': -445.73968505859375,
         'y2': -501.2085266113281},
        {'FORM_TYPE': 2147483650,
         'x': 274.6957702636719,
         'x2': 351.29290771484375,
         'y': -464.0181579589844,
         'y2': -501.08331298828125},
        {'FORM_TYPE': 3,
         'x': 251.38336181640625,
         'x2': 0.0,
         'y': -512.1669921875,
         'y2': 0.0},
        {'FORM_TYPE': 3,
         'x': 228.04940795898438,
         'x2': 0.0,
         'y': -560.3053588867188,
         'y2': 0.0},
        {'FORM_TYPE': 1,
         'x': 204.64102172851562,
         'x2': -17969.142578125,
         'y': -608.4076538085938,
         'y2': 8265.3916015625},
        {'FORM_TYPE': 2,
         'x': 181.10546875,
         'x2': -17969.142578125,
         'y': -656.4478759765625,
         'y2': 8265.3916015625},
        {'FORM_TYPE': 1,
         'x': 155.2604522705078,
         'x2': -109.89336395263672,
         'y': -700.0466918945312,
         'y2': -513.406005859375},
        {'FORM_TYPE': 2,
         'x': 122.93714904785156,
         'x2': -109.89336395263672,
         'y': -739.0855102539062,
         'y2': -513.406005859375},
        {'FORM_TYPE': 1,
         'x': 84.92530822753906,
         'x2': -109.89336395263672,
         'y': -772.6105346679688,
         'y2': -513.406005859375},
        {'FORM_TYPE': 2,
         'x': 42.15363311767578,
         'x2': -109.89336395263672,
         'y': -799.8026123046875,
         'y2': -513.406005859375},
        {'FORM_TYPE': 1,
         'x': 1.1382473707199097,
         'x2': -109.4797134399414,
         'y': -818.0496826171875,
         'y2': -514.1851806640625},
        {'FORM_TYPE': 2,
         'x': -42.0089111328125,
         'x2': -109.4797134399414,
         'y': -830.4408569335938,
         'y2': -514.1851806640625},
        {'FORM_TYPE': 0,
         'x': -170.59378051757812,
         'x2': 0.0,
         'y': -857.8734741210938,
         'y2': 0.0},
        {'FORM_TYPE': 1,
         'x': -236.68865966796875,
         'x2': -188.45225524902344,
         'y': -844.8705444335938,
         'y2': -774.16552734375},
        {'FORM_TYPE': 2,
         'x': -263.0478210449219,
         'x2': -188.848876953125,
         'y': -815.9838256835938,
         'y2': -774.7469482421875},
        {'FORM_TYPE': 3,
         'x': -312.0104064941406,
         'x2': 0.0,
         'y': -727.8838500976562,
         'y2': 0.0},
        {'FORM_TYPE': 1,
         'x': -316.3728942871094,
         'x2': -281.7187194824219,
         'y': -710.7515258789062,
         'y2': -711.0488891601562},
        {'FORM_TYPE': 2147483650,
         'x': -320.73541259765625,
         'x2': -351.027099609375,
         'y': -693.6192626953125,
         'y2': -710.4541625976562},
        {'FORM_TYPE': 2147483649,
         'x': -329.1017150878906,
         'x2': -8200.814453125,
         'y': -678.5992431640625,
         'y2': -5073.0625},
        {'FORM_TYPE': 2147483650,
         'x': -337.49664306640625,
         'x2': -8200.814453125,
         'y': -663.59521484375,
         'y2': -5073.0625},
etc. etc.]

...and while the straights (form type 0) are easy to plot, the corners (form type everything else) are a bit more difficult.

I think @tarnheld figured out how to do it using biarcs, but personally I'm clueless.

Edit: It seems like the x2 y2 coordinates is the circle center of the arc...
 
Last edited:
- show the start / finish line positions on the map
Noted, stay tuned :)
- show a minimap of the track in the elevation editor
If you open the elevation editor from the ted editor (by pressing "e") the track window stays open and there is an indication in the track canvas where you are in the elevation window, a small black circle wandering around the track when you move on the elevation display area.

I think @tarnheld figured out how to do it using biarcs, but personally I'm clueless.

I think the merging of both tools is best to achieve the display, a minimap could certainly be done by ripping out the display stuff from the ted editor and adding it to the elevation editor, but it would take some time to get it right. Maybe we can work on that later.
BTW, i think it would be easy and a nice feature if not only the position is indicated in the track view but also the extents of manipulation of the heights in the elevation editor, so not only a circle is shown, but a rectangle wrapped around the part of the track that is influenced by the elevation editing.

Also, I went quite quickly through the topic, but does the editor allows for roadside object placement or do you have to edit it manually in the code directly ?

Right now all road and deco stuff is taken from the imported ted file and only scaled to the new track length on export. I'm currently working on an editor for this, but it's not finished yet. It's a bit tricky as every piece of geometry that can be placed has a specific length and in order to get a continuous road surface (without gaps) the pieces have to be put together to cover the whole track, not be stretched or shrinked too much and still be in the place where the user wants them to be. PD nicely sidestepped the issue by not allowing you to alter the road geometry but placing it all automatically but we all want more than that... :mischievous::lol:
 
.....in order to get a continuous road surface (without gaps) the pieces have to be put together to cover the whole track, not be stretched or shrinked too much and still be in the place where the user wants them to be. PD nicely sidestepped the issue by not allowing you to alter the road geometry but placing it all automatically but we all want more than that... :mischievous::lol:


And that, my friends, is what drives us on.......

(:embarrassed: Sorry, couldn't resist it!)
 
If you open the elevation editor from the ted editor (by pressing "e") the track window stays open and there is an indication in the track canvas where you are in the elevation window, a small black circle wandering around the track when you move on the elevation display area.

Ha, I see, seems obvious now that I read it, but I put the elevation editor window in full size so didn't see it :lol:
 
Back