change python scripts so modules which register with blender have a register() functi...
[blender.git] / release / scripts / ui / space_time.py
index 65e7405c3fe13933607f7d419db0b316a63a5db3..b5be1b5da567ff5b8413b2b9a4991ea29806ee1f 100644 (file)
@@ -12,7 +12,7 @@
 #
 #  You should have received a copy of the GNU General Public License
 #  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # ##### END GPL LICENSE BLOCK #####
 
@@ -130,7 +130,6 @@ class TIME_MT_frame(bpy.types.Menu):
         layout.separator()
 
         sub = layout.row()
-        #sub.active = tools.enable_auto_key
         sub.menu("TIME_MT_autokey")
 
 
@@ -165,13 +164,23 @@ class TIME_MT_autokey(bpy.types.Menu):
         layout = self.layout
         tools = context.tool_settings
 
-        layout.active = tools.enable_auto_key
-
         layout.prop_enum(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
         layout.prop_enum(tools, "autokey_mode", 'REPLACE_KEYS')
 
-bpy.types.register(TIME_HT_header)
-bpy.types.register(TIME_MT_view)
-bpy.types.register(TIME_MT_frame)
-bpy.types.register(TIME_MT_autokey)
-bpy.types.register(TIME_MT_playback)
+classes = [
+    TIME_HT_header,
+    TIME_MT_view,
+    TIME_MT_frame,
+    TIME_MT_autokey,
+    TIME_MT_playback]
+
+
+def register():
+    register = bpy.types.register
+    for cls in classes:
+        register(cls)
+
+def unregister():
+    unregister = bpy.types.unregister
+    for cls in classes:
+        unregister(cls)