Blender dof exporter

Alright, it's functional enough I'm comfortable uploading it. Several improvements to the python script used for exporting DOFs from Blender.

Download:
http://nmurdoch.ca/scripts/io_export_dof.zip

Compatibility:
Blender 2.63 is I believe the earliest version with one specific change that necessitated updating the script. I've tested it in 2.71.

Installation:
Open User Preferences, pick 'Install from File' along the bottom edge. Pick the zip. Go to the Addons tab, and check it. Save User Settings.
7RnK0GX.jpg

Once you've done this, it should be available in the File>Export menu.

Usage:
Selecting it will bring up the File Save window, with this sidebar:
uuSSVYW.jpg

For now, it can only save to a single dof. I plan to add the batch-style one dof per object again as an option at some point.
If "Selected Objects" is checked, it'll export the selection - otherwise it'll export everything that can be converted into a mesh.
If "Apply Modifiers" is checked, it does the obvious, collapses the modifier stack (to be technical, it's using 'PREVIEW' mode - you'll get what you see in the 3d window)
"Use Parent Origin" transforms objects so their origin is the parent object's. This is to allow the following:
zjMn8L3.jpg

By placing the Empty "WHEEL_LF" at the center of the wheel, the wheel can be left in its natural position on the model, and on export, the coordinates will treat the location of that empty "WHEEL_LF" as zero, so the wheel rotates correctly.
"Plus 90 Around X" is just a convenience function for me - Assetto Corsa, the other game I export to, sets up the steering wheel to rotate around +Y, whereas Racer uses +Z, so by checking this, I can export for Racer without having to rotate it back to the Z axis.


Fixes vs. the one I had from radome a while ago:
- compatibility with latest (2.63+) versions of Blender by changing 'faces' to 'tessfaces'
- object position, rotation, and scale are now handled more correctly (you shouldn't need to apply rotations)


Gotchas:
- all objects need a Material assigned.
- all objects need a UV Map assigned (gonna change this so it just writes 0's)
- vertex colours no longer supported (although I am not sure their use case)
- texture names are not currently being referenced from the material. I don't think anyone uses this in the 0.9.0RCs. If you really need it to work, it's currently writing "<MaterialName>.tga" - so if your material's named 'Rim-12spoke', it'll be looking for 'Rim-12spoke.tga'.
- no check for GOB1 size limits - I've heard more than 20k vertices in a single material is a problem but have not personally tested yet.

Misc:
No warranty, etc. save your blend file before trying this. Feel free to upload & modify to other sites.
 
Last edited:
Fixed some bugs - found why faces were missing (apparently that 2.63 update changed the specs on the array of faces in a subtle way, so faces using vertex 0 didn't always export - or maybe this was a bug in the old one too, I didn't use it a huge amount) - corrected the rotation of normals during the use of 'parent origin' option. File available at the same url in the original post.
 
http://nmurdoch.ca/scripts/io_export_dof_0.3.zip
New version that I won't overwrite the old because I don't have the time to exhaustively test again; adds ability to export vertex colors (which does work).
* check the box on the export screen to include them
* all objects selected must have vertex colors painted on for it to work
* it'll use the active vertex colors if multiple are present

Hopefully I'll add the 'batch' mode that will write out a whole folder of .dofs at once next (for making tracks).
 

Latest News

How long have you been simracing

  • < 1 year

    Votes: 299 15.3%
  • < 2 years

    Votes: 206 10.6%
  • < 3 years

    Votes: 200 10.3%
  • < 4 years

    Votes: 150 7.7%
  • < 5 years

    Votes: 265 13.6%
  • < 10 years

    Votes: 229 11.8%
  • < 15 years

    Votes: 145 7.4%
  • < 20 years

    Votes: 117 6.0%
  • < 25 years

    Votes: 88 4.5%
  • Ok, I am a dinosaur

    Votes: 249 12.8%
Back
Top