remove register/unregister from templates
authorCampbell Barton <ideasman42@gmail.com>
Mon, 2 Aug 2010 03:30:07 +0000 (03:30 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 2 Aug 2010 03:30:07 +0000 (03:30 +0000)
release/scripts/templates/operator.py
release/scripts/templates/operator_modal.py
release/scripts/templates/operator_modal_draw.py
release/scripts/templates/operator_modal_view3d.py
release/scripts/templates/operator_simple.py
release/scripts/templates/operator_uv.py
release/scripts/templates/panel_simple.py

index 038e76bd6d36adaaf1d1489c0e1ad2fe1dce091a..9cb544886da3ad44eb3c2458c6a085b589b3e274 100644 (file)
@@ -54,8 +54,6 @@ class ExportSomeData(bpy.types.Operator):
             return self.execute(context)
 
 
-
-
 # Only needed if you want to add into a dynamic menu
 menu_func = lambda self, context: self.layout.operator("export.some_data", text="Example Exporter...")
 bpy.types.INFO_MT_file_export.append(menu_func)
index e029d91a7fa8540799e3eeaa9ef7d7c96a05f324..0c5db47674bae0401ff2e8c1d7f438b3f18d8d3d 100644 (file)
@@ -34,7 +34,5 @@ class ModalOperator(bpy.types.Operator):
             return {'CANCELLED'}
 
 
-bpy.types.register(ModalOperator)
-
 if __name__ == "__main__":
     bpy.ops.object.modal_operator()
index 1f24672346bb0043f35ebcd7e6d770734fb41d74..56ffb95f5552d6adbef24abc07fcf0ade4ef31ac 100644 (file)
@@ -64,15 +64,3 @@ class ModalDrawOperator(bpy.types.Operator):
         else:
             self.report({'WARNING'}, "View3D not found, cannot run operator")
             return {'CANCELLED'}
-
-
-def register():
-    bpy.types.register(ModalDrawOperator)
-
-
-def unregister():
-    bpy.types.unregister(ModalDrawOperator)
-
-
-if __name__ == "__main__":
-    register()
index da019c2b653e667d0b0613c0ad8da691634a22d0..9b49fd947adc43b05649a52c711fd61c7b793635 100644 (file)
@@ -51,6 +51,3 @@ class ViewOperator(bpy.types.Operator):
         else:
             self.report({'WARNING'}, "Active space must be a View3d")
             return {'CANCELLED'}
-
-
-bpy.types.register(ViewOperator)
index 739c1aa7d26b2aa6bd9fbbed93d5366ce99de3bf..e241afd23b797e5162bdd23a7f313bb745da9a51 100644 (file)
@@ -16,11 +16,6 @@ class SimpleOperator(bpy.types.Operator):
         main(context)
         return {'FINISHED'}
 
-def register():
-    pass
-
-def unregister():
-    pass
 
 if __name__ == "__main__":
-    register()
+    bpy.ops.object.simple_operator()
index 395b0bb3f24d0f0de708ef862ab95da970ce5852..f8c8e369ec8eeb7c66c091e379bbd535c5fd9b54 100644 (file)
@@ -24,8 +24,9 @@ def main(context):
     if is_editmode:
         bpy.ops.object.mode_set(mode='EDIT', toggle=False)
 
+
 class UvOperator(bpy.types.Operator):
-    ''''''
+    '''UV Operator description'''
     bl_idname = "uv.simple_operator"
     bl_label = "Simple UV Operator"
 
index 531f9f1a106a7edfb4d5afe21b0eb13a5412047b..7c73e58a3e51db128b496ae369c44917b12b1b13 100644 (file)
@@ -18,4 +18,3 @@ class OBJECT_PT_hello(bpy.types.Panel):
         row.label(text="Active object is: " + obj.name)
         row = layout.row()
         row.prop(obj, "name")
-