#!BPY

"""
Name: 'Racer DOF (.dof)'
Blender: 241
Group: 'Export'
Tooltip: 'Export to Racer DOF format.'
"""


# Export layer 1 meshes as DOF
#

######################################################
# Importing modules
######################################################
import os
import Mesh2DOF
import Blender
import BPyMessages



# ==============================
# ====== Write DOF Format ======
# ==============================
def write(filename):

    print "----- Exporting into " + filename

    if not os.path.exists(filename):
        os.mkdir(filename)

    os.chdir(filename)

    Mesh2DOF.ExportLayer(1, filename)


def fs_callback(filename):

	#if not filename.lower().endswith('.dof'): filename += '.dof'
	write(filename)

Blender.Window.FileSelector(fs_callback, "Export DOF", Blender.sys.makename(ext=''))

