Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2012-05-27 13:38:39 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-05-27 13:38:39 +0400
commite8e36e184bf3c3f21036a4f6099cbabfc3470ceb (patch)
tree1e5229741096f9e2c399e1f993e122ab0dbc8336 /io_mesh_raw
parentb3b6179c6e6db043c6a5a7fce7cb3aaeba449670 (diff)
Turned out only raw exporter had same bug...
Also, only calc_tessface() when needed, and use ExportHelper for RAW!
Diffstat (limited to 'io_mesh_raw')
-rw-r--r--io_mesh_raw/__init__.py22
-rw-r--r--io_mesh_raw/export_raw.py2
2 files changed, 7 insertions, 17 deletions
diff --git a/io_mesh_raw/__init__.py b/io_mesh_raw/__init__.py
index d677e453..079248d7 100644
--- a/io_mesh_raw/__init__.py
+++ b/io_mesh_raw/__init__.py
@@ -43,6 +43,7 @@ else:
import bpy
from bpy.props import StringProperty, BoolProperty
+from bpy_extras.io_utils import ExportHelper
class RawImporter(bpy.types.Operator):
@@ -67,20 +68,14 @@ class RawImporter(bpy.types.Operator):
return {'RUNNING_MODAL'}
-class RawExporter(bpy.types.Operator):
+class RawExporter(bpy.types.Operator, ExportHelper):
'''Save Raw triangle mesh data'''
bl_idname = "export_mesh.raw"
bl_label = "Export RAW"
- filepath = StringProperty(
- subtype='FILE_PATH',
- )
- check_existing = BoolProperty(
- name="Check Existing",
- description="Check and warn on overwriting existing files",
- default=True,
- options={'HIDDEN'},
- )
+ filename_ext = ".raw"
+ filter_glob = StringProperty(default="*.raw", options={'HIDDEN'})
+
apply_modifiers = BoolProperty(
name="Apply Modifiers",
description="Use transformed mesh data from each object",
@@ -101,13 +96,6 @@ class RawExporter(bpy.types.Operator):
return {'FINISHED'}
- def invoke(self, context, event):
- if not self.filepath:
- self.filepath = bpy.path.ensure_ext(bpy.data.filepath, ".raw")
- wm = context.window_manager
- wm.fileselect_add(self)
- return {'RUNNING_MODAL'}
-
def menu_import(self, context):
self.layout.operator(RawImporter.bl_idname, text="Raw Faces (.raw)")
diff --git a/io_mesh_raw/export_raw.py b/io_mesh_raw/export_raw.py
index a1801518..b5c5ef36 100644
--- a/io_mesh_raw/export_raw.py
+++ b/io_mesh_raw/export_raw.py
@@ -75,6 +75,8 @@ def write(filepath,
is_tmp_mesh = True
else:
me = obj.data
+ if not me.tessfaces and me.polygons:
+ me.calc_tessface()
is_tmp_mesh = False
if me is not None: