08-24-2007, 02:30 PM,
|
|
alex25
Senior Member
   
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
joevenzon Wrote:You could just export the track to .joe format once you get it into blender. The extra step of exporting as dof and editing them in tracked is pretty unnecessary
except that exporting directly to joe format never quite works. trying to export imola directly to joe i get (after a while):
Code: found default filename from GUI
Traceback (most recent call last):
File "export-all-joe-0.3.py", line 691, in bevent
save_joe(g_filename.val + "-object-" + nextObject.name + ".joe", nextObject)
File "export-all-joe-0.3.py", line 525, in save_joe
joe.save(file)
File "export-all-joe-0.3.py", line 216, in save
self.frames[i].save(file)
File "export-all-joe-0.3.py", line 180, in save
self.texcoords[i].save(file)
File "export-all-joe-0.3.py", line 145, in save
data=struct.pack(self.binary_format, temp_data[0], temp_data[1])
SystemError: frexp() result out of range
and i end up with an empty object. exporting to dof works just fine. this is with blender 2.44.
--alex--
|
|
08-25-2007, 12:05 PM,
|
|
joevenzon
Administrator
      
|
Posts: 2,679
Threads: 52
Joined: Jun 2005
|
|
alex25 Wrote:except that exporting directly to joe format never quite works. trying to export imola directly to joe i get (after a while):
Code: found default filename from GUI
Traceback (most recent call last):
File "export-all-joe-0.3.py", line 691, in bevent
save_joe(g_filename.val + "-object-" + nextObject.name + ".joe", nextObject)
File "export-all-joe-0.3.py", line 525, in save_joe
joe.save(file)
File "export-all-joe-0.3.py", line 216, in save
self.frames[i].save(file)
File "export-all-joe-0.3.py", line 180, in save
self.texcoords[i].save(file)
File "export-all-joe-0.3.py", line 145, in save
data=struct.pack(self.binary_format, temp_data[0], temp_data[1])
SystemError: frexp() result out of range
and i end up with an empty object. exporting to dof works just fine. this is with blender 2.44.
Hmm, then we should fix the exporter! The error is happening when it's writing the UV coordinates. According to this:
http://mail.python.org/pipermail/python-...86515.html
that error usually happens when the value is much too big, much too small, or Not A Number. I've added checks for this into the export-all script. It's in the VDrift art repository, R90.
|
|
08-25-2007, 12:12 PM,
|
|
alex25
Senior Member
   
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
joevenzon Wrote:No, GetParam() returns whatever is set in the track.txt file. If there's nothing in there, it defaults to false. On Imola this returns true, since it's turned on in the track.txt file. You can put in a cout to see for yourself, if you want. :-) I did find a bug that was causing the old value to stick on if you loaded multiple tracks in a row, though -- that's fixed in R1822. Can you see if R1822 behaves as you expect? At this point it behaves as I expect, but we may have differing expectations!
r1822 seems to work fine. when i was testing before, i was loading multiple tracks in a row so that might explain why i though vertical tracking stopped working.
--alex--
|
|
08-30-2007, 01:01 PM,
|
|
alex25
Senior Member
   
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
joevenzon Wrote:Hmm, then we should fix the exporter!
okay, so that error seems to be fixed, i can export imola and it looks good (although i didn't do an exhaustive comparison with the old method). but now if i try to export suzuka using the joe export script, i get:
Code: Traceback (most recent call last):
File "export-all-joe-0.3.py", line 695, in bevent
listfile.write(os.path.basename(nextObject.getData().faces[0].image.getFilename())+"\n")
AttributeError: 'NoneType' object has no attribute 'getFilename'
one of these days maybe i'll learn python.
--alex--
|
|
08-30-2007, 02:25 PM,
|
|
alex25
Senior Member
   
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
joevenzon Wrote:no lighting from that step will get exported to .joe (VDrift calculates lighting in real-time).
this statement is not quite true: there is lighting information exported but vdrift is probably not using it. on the other hand, the trackeditor is using this information and if i don't add it in racer before converting the dof files to joe, then the objects are very dark in the trackeditor and it's almost impossible to do any track editing. maybe the track editor needs to be updated as well.
--alex--
|
|
08-31-2007, 02:33 PM,
|
|
alex25
Senior Member
   
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
joevenzon Wrote:If I recall correctly, the .dof format doesn't have surface normals (which are what lighting is calculated with in VDrift), but it bakes lighting into the mesh by adjusting the vertex color. This is a crappy way to do it and so the dof2joe converter discards the vertex color info
i am not an expert on the "joe" format (you should be) but as i said in my previous message, if i don't add lighting in racer the converted objects look very dark in the track editor. if i do, then they look okay and i can trace the track. clearly there is some information that's being added/saved there.
--alex--
|
|
09-01-2007, 12:43 AM,
|
|
joevenzon
Administrator
      
|
Posts: 2,679
Threads: 52
Joined: Jun 2005
|
|
I looked into this more, and the racer dof format can also store normals (although it doesn't always) -- my mistake. As for the .joe format, it only stores normals (not vertex color), and will generate normals if they aren't in the dof file (which they aren't for some tracks' .dof files). However, all of this should be moot as the normals get written from blender by the joe exporter. It sounds like the normals aren't set up properly in blender, and the racer track editor is fixing it. I can offer some suggestions about how to make sure the normals are correct in blender: select all objects (A), open the editing panel (F9), make sure the mesh is not double sided (in the Mesh box), then hit "Set Solid" (in the Link and Materials box). Have you tried this already? If so, could you send me the blender file (maybe delete most of the objects first so it's not huge)?
|
|
09-14-2007, 03:29 PM,
|
|
alex25
Senior Member
   
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
joevenzon Wrote:My guess is that in rfactor/racer they don't do the "object center" translation -- it's a bit odd. They probably either do nothing or translate up by the camera height. Do you have any way to check out pictures of imola running in racer/rfactor? I wonder what it looks like... maybe it *is* just like the middle picture you posted.
i think i finally figured out how the sky rendering works in rFactor. looks like they can specify the position of the sky objects which then helps position the objects properly.
i propose we do something similar. probably the best place to do this is in track.txt. if an objects is flagged as a skybox then one would look for the corresponding position in track.txt. for example, let's take imola. the rFactor specifies the following:
Code: MeshFile=skyboxi.gmt {Pos=(0.0,-27.0,0.0)}
MeshFile=Sky.gmt {Pos=(0.0,-7.0,0.0)}
the equivalent in track.txt would be:
Code: spea0349_bka.dof-00 position: 0.0 -27.0 0.0
skyb0348_sky.dof-00 position: 0.0 -7.0 0.0
this could get a bit more complicated because in some cases the horizon object gets broken into multiple objects. this leads me to a second option where we would extend the skybox flag to mean 1 for the horizon and 2 for the sky. in this case track.txt would look like:
Code: horizon position: 0.0 -27.0 0.0
sky position: 0.0 -7.0 0.0
personally i would go with this second option, and if we agree on it i could probably come up with a patch (and fix all the tracks as well). let me know what you think.
--alex--
|
|
|