change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / op / uv.py
index 1c425f6c451ec2ffc8ce328e5f13c8e723b125e7..95a234b9c79a8b689434fc7d5103839b0cae2a5d 100644 (file)
@@ -196,15 +196,16 @@ class ExportUVLayout(bpy.types.Operator):
         wm.add_fileselect(self)
         return {'RUNNING_MODAL'}
 
-# Register the operator
-bpy.types.register(ExportUVLayout)
-
 
 def menu_func(self, context):
     default_path = bpy.data.filename.replace(".blend", ".svg")
     self.layout.operator(ExportUVLayout.bl_idname).path = default_path
 
-bpy.types.IMAGE_MT_uvs.append(menu_func)
 
-#if __name__ == "__main__":
-#    bpy.ops.uv.export_layout(path="/home/ideasman42/foo.svg")
+def register():
+    bpy.types.register(ExportUVLayout)
+    bpy.types.IMAGE_MT_uvs.append(menu_func)
+
+def unreguster():
+    bpy.types.unregister(ExportUVLayout)
+    bpy.types.IMAGE_MT_uvs.remove(menu_func)