diff --git a/tools/io_mesh_qfmdl/__init__.py b/tools/io_mesh_qfmdl/__init__.py index 302d92424..5ee7375ef 100644 --- a/tools/io_mesh_qfmdl/__init__.py +++ b/tools/io_mesh_qfmdl/__init__.py @@ -88,6 +88,10 @@ class QFMDLSettings(bpy.types.PropertyGroup): script = StringProperty( name="Script", description="Script for animating frames and skins") + xform = BoolProperty( + name="Auto transform", + description="Auto-apply location/rotation/scale when exporting", + default=True) md16 = BoolProperty( name="16-bit", description="16 bit vertex coordinates: QuakeForge only") @@ -143,6 +147,7 @@ class MDLPanel(bpy.types.Panel): layout.prop(obj.qfmdl, "rotate") layout.prop(obj.qfmdl, "effects") layout.prop(obj.qfmdl, "script") + layout.prop(obj.qfmdl, "xform") layout.prop(obj.qfmdl, "md16") def menu_func_import(self, context): diff --git a/tools/io_mesh_qfmdl/export_mdl.py b/tools/io_mesh_qfmdl/export_mdl.py index ec8b19dd7..34e9f4696 100644 --- a/tools/io_mesh_qfmdl/export_mdl.py +++ b/tools/io_mesh_qfmdl/export_mdl.py @@ -260,6 +260,8 @@ def process_frame(mdl, scene, frame, vertmap, ingroup = False, return fr.frames[-1] scene.frame_set (int(frameno), frameno - int(frameno)) mesh = mdl.obj.to_mesh (scene, True, 'PREVIEW') #wysiwyg? + if mdl.obj.qfmdl.xform: + mesh.transform (mdl.obj.matrix_world) fr = make_frame(mesh, vertmap) fr.name = name return fr @@ -287,6 +289,8 @@ def export_mdl(operator, context, filepath): if not mdl.skins: make_skin(mdl, mesh) if not mdl.frames: + if mdl.obj.qfmdl.xform: + mesh.transform (mdl.obj.matrix_world) mdl.frames.append(make_frame(mesh, vertmap)) convert_stverts (mdl, mdl.stverts) mdl.size = calc_average_area(mdl)