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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/op/uv.py')
-rw-r--r--release/scripts/op/uv.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py
index a7abd475b8d..7d677181858 100644
--- a/release/scripts/op/uv.py
+++ b/release/scripts/op/uv.py
@@ -39,7 +39,8 @@ class ExportUVLayout(bpy.types.Operator):
description="File format to export the UV layout to",
default='SVG')
- def poll(self, context):
+ @classmethod
+ def poll(cls, context):
obj = context.active_object
return (obj and obj.type == 'MESH')
@@ -113,7 +114,9 @@ class ExportUVLayout(bpy.types.Operator):
mode = self.properties.mode
- file = open(self.properties.filepath, "w")
+ filepath = self.properties.filepath
+ filepath = bpy.path.ensure_ext(filepath, "." + mode.lower())
+ file = open(filepath, "w")
fw = file.write
if mode == 'SVG':
@@ -216,12 +219,10 @@ def menu_func(self, context):
def register():
- bpy.types.register(ExportUVLayout)
bpy.types.IMAGE_MT_uvs.append(menu_func)
def unregister():
- bpy.types.unregister(ExportUVLayout)
bpy.types.IMAGE_MT_uvs.remove(menu_func)
if __name__ == "__main__":