# This file is part of a migration of an original package to
# the new Blender 2.5 architecture. Regarding the copying of files
# in that package the original author stated ->>
# ->>This file may be copied. However, if you make improvements,
# ->>please send me a copy.
#
# Revision history---------------------------------------------------
# ->>Brent Burton <brentb@relro.net>
# ->>Originally released: July 2003
# ->>RaceSimCentral: vizor_atx
# ->>----------------------------------------------------------------
# radome <radome914gt@att.net>
# Migration to Blender 2.5 architecture: 2010 - 2011
# ->>Convert a Blender NMesh object to a DOF
# -------------------------------------------------------------------
# ->>file. This module needs the DOFfile module.
#
bl_info = {
"name": "Mesh2DOF",
"author": "Brent Burton, migration to 2.5 by radome",
"version": (0, 2, 2),
"blender": (2, 5, 7),
"api": 35622,
"location": "File > Export",
"description": "Export Mesh Objects to DOF1 files",
"warning": "Work In Progress",
"wiki_url": "",
"tracker_url": "",
"support": 'COMMUNITY',
"category": "Import-Export"}
# Reload the package on Blender F8 keypress
if "bpy" in locals():
import imp
if "Mesh2DOF" in locals():
imp.reload(Mesh2DOF)
import bpy
from bpy.props import BoolProperty, FloatProperty, StringProperty
from io_utils import ExportHelper, ImportHelper
class ExportDOF(bpy.types.Operator, ExportHelper):
'''Export mesh objects as DOF (.dof) files'''
bl_idname = "mesh_obj.dof"
bl_label = "Mesh Objects to DOF"
bl_options = {'PRESET'}
directory = bpy.props.StringProperty(subtype="DIR_PATH")
filename_ext = ".dof"
filter_glob = StringProperty(default="*.dof;*.DOF", options={'HIDDEN'})
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
# context group
use_selection = BoolProperty(name="Selection Only", description="Export selected objects only", default=False)
layer = StringProperty(name="Scene Layer Number", description="Export from this scene layer number", default="1")
scale = FloatProperty(name="Scale", description="Scale is an inverse-modeling factor", default=1.0)
def execute(self, context):
from . import Mesh2DOF
# if not use_selection:
return Mesh2DOF.ExportLayer(self, context, **self.as_keywords(ignore=("check_existing", "filter_glob")))
# else:
# return Mesh2DOF.ExportLayer(specific_layer, targetdir, target_scale)
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
def menu_func_export(self, context):
self.layout.operator(ExportDOF.bl_idname, text="DOF1 (.dof)")
def register():
bpy.utils.register_module(__name__)
bpy.types.INFO_MT_file_export.append(menu_func_export)
def unregister():
bpy.utils.unregister_module(__name__)
bpy.types.INFO_MT_file_export.remove(menu_func_export)
if __name__ == "__main__":
register()