RNA Types metaclass registration
authorMartin Poirier <theeth@yahoo.com>
Mon, 2 Aug 2010 02:55:12 +0000 (02:55 +0000)
committerMartin Poirier <theeth@yahoo.com>
Mon, 2 Aug 2010 02:55:12 +0000 (02:55 +0000)
See mailing list posts for details [1][2][3]

Addons still need to be fixed; Campbell said he'd do it today.

See any of the py files (outside netrender) in this commit for how to do it (it's rather simple).

[1] http://lists.blender.org/pipermail/bf-committers/2010-February/026328.html
[2] http://lists.blender.org/pipermail/bf-committers/2010-August/028311.html
[3] http://lists.blender.org/pipermail/bf-committers/2010-August/028321.html

84 files changed:
release/scripts/io/export_3ds.py
release/scripts/io/export_fbx.py
release/scripts/io/export_mdd.py
release/scripts/io/export_obj.py
release/scripts/io/export_ply.py
release/scripts/io/export_x3d.py
release/scripts/io/import_anim_bvh.py
release/scripts/io/import_scene_3ds.py
release/scripts/io/import_scene_obj.py
release/scripts/io/import_shape_mdd.py
release/scripts/io/netrender/client.py
release/scripts/io/netrender/operators.py
release/scripts/io/netrender/ui.py
release/scripts/io/netrender/utils.py
release/scripts/modules/bpy/utils.py
release/scripts/modules/bpy_types.py
release/scripts/modules/rna_prop_ui.py
release/scripts/op/add_armature_human.py
release/scripts/op/add_mesh_torus.py
release/scripts/op/fcurve_euler_filter.py
release/scripts/op/image.py
release/scripts/op/mesh.py
release/scripts/op/nla.py
release/scripts/op/object.py
release/scripts/op/object_align.py
release/scripts/op/object_randomize_transform.py
release/scripts/op/presets.py
release/scripts/op/screen_play_rendered_anim.py
release/scripts/op/sequencer.py
release/scripts/op/uv.py
release/scripts/op/uvcalc_follow_active.py
release/scripts/op/uvcalc_smart_project.py
release/scripts/op/vertexpaint_dirt.py
release/scripts/op/wm.py
release/scripts/templates/operator.py
release/scripts/templates/operator_simple.py
release/scripts/templates/operator_uv.py
release/scripts/templates/panel_simple.py
release/scripts/ui/properties_animviz.py
release/scripts/ui/properties_data_armature.py
release/scripts/ui/properties_data_armature_rigify.py
release/scripts/ui/properties_data_bone.py
release/scripts/ui/properties_data_camera.py
release/scripts/ui/properties_data_curve.py
release/scripts/ui/properties_data_empty.py
release/scripts/ui/properties_data_lamp.py
release/scripts/ui/properties_data_lattice.py
release/scripts/ui/properties_data_mesh.py
release/scripts/ui/properties_data_metaball.py
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_game.py
release/scripts/ui/properties_material.py
release/scripts/ui/properties_object.py
release/scripts/ui/properties_object_constraint.py
release/scripts/ui/properties_particle.py
release/scripts/ui/properties_physics_cloth.py
release/scripts/ui/properties_physics_field.py
release/scripts/ui/properties_physics_fluid.py
release/scripts/ui/properties_physics_smoke.py
release/scripts/ui/properties_physics_softbody.py
release/scripts/ui/properties_render.py
release/scripts/ui/properties_scene.py
release/scripts/ui/properties_texture.py
release/scripts/ui/properties_world.py
release/scripts/ui/space_console.py
release/scripts/ui/space_dopesheet.py
release/scripts/ui/space_filebrowser.py
release/scripts/ui/space_graph.py
release/scripts/ui/space_image.py
release/scripts/ui/space_info.py
release/scripts/ui/space_logic.py
release/scripts/ui/space_nla.py
release/scripts/ui/space_node.py
release/scripts/ui/space_outliner.py
release/scripts/ui/space_sequencer.py
release/scripts/ui/space_text.py
release/scripts/ui/space_time.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_userpref_keymap.py
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna.h

index 910d462a9f9d9d7d2af1247f19c1a0c5ae250226..22b842b29051299a7655e2e486e3abecb523bc63 100644 (file)
@@ -1138,7 +1138,6 @@ class Export3DS(bpy.types.Operator):
     def poll(self, context): # Poll isnt working yet
         return context.active_object != None
 
-
 # Add to a menu
 def menu_func(self, context):
     default_path = os.path.splitext(bpy.data.filepath)[0] + ".3ds"
@@ -1146,11 +1145,9 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(Export3DS)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(Export3DS)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":
index 72b03a110bdea449dbed09d2f5321c4b65458e7e..8d28500dba524ee2721333c784f359440e10bc26 100644 (file)
@@ -3439,12 +3439,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportFBX)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(ExportFBX)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":
index d2e53070910b64271198f859fd3967f6bf18275a..5cbda8a76b796268e0c2cb721c4edc7cc8cbfdc9 100644 (file)
@@ -189,12 +189,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportMDD)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(ExportMDD)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":
index a4d98aac12eb8cbc86963ec0bc30f66647039871..4100c2a5de9692391664395f8bcc68b3cd5c4c1e 100644 (file)
@@ -970,11 +970,9 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportOBJ)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(ExportOBJ)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 
index 07865e4f65a43de2100750229b887645a9b91258..03529c4023c212d70d36017ebeb2032a39ec3ec2 100644 (file)
@@ -317,12 +317,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportPLY)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(ExportPLY)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 if __name__ == "__main__":
index 7f5dd57171c1ccc065e4f81941a8acd48f9980ea..b2f2647fc3aa9ef9111a172e68a94a7aac63b60d 100644 (file)
@@ -1248,11 +1248,9 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(ExportX3D)
     bpy.types.INFO_MT_file_export.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(ExportX3D)
     bpy.types.INFO_MT_file_export.remove(menu_func)
 
 # NOTES
index 89097fd53f59ecbbc659ac1dbadcc3b82194aee1..ba9b8a1f91d79b159bff2c4d7471158ad47afc19 100644 (file)
@@ -612,12 +612,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(BvhImporter)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(BvhImporter)
     bpy.types.INFO_MT_file_import.remove(menu_func)
 
 if __name__ == "__main__":
index 435e08a209e38f4cca62ac727f8999ee62b6678a..fe242ca1f292a9c4583f0c0e5b56e3ecbe76219e 100644 (file)
@@ -1032,11 +1032,9 @@ def menu_func(self, context):
     self.layout.operator(IMPORT_OT_autodesk_3ds.bl_idname, text="3D Studio (.3ds)")
 
 def register():
-    bpy.types.register(IMPORT_OT_autodesk_3ds)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(IMPORT_OT_autodesk_3ds)
     bpy.types.INFO_MT_file_import.remove(menu_func)
 
 # NOTES:
index 5b29a5ded909ab21e6e34f94a8b174bd965fbef0..e832489a56020f238bbedcc0f496691d893a553d 100644 (file)
@@ -1606,11 +1606,9 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(IMPORT_OT_obj)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
 def unregister():
-    bpy.types.unregister(IMPORT_OT_obj)
     bpy.types.INFO_MT_file_import.remove(menu_func)
 
 
index ec0e7696630abd333e9ac07d21160be6e8a1dcfe..16fed1798c459aa7fd982418fa4977c577dd7298 100644 (file)
@@ -143,12 +143,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(importMDD)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(importMDD)
     bpy.types.INFO_MT_file_import.remove(menu_func)
 
 if __name__ == "__main__":
index 9f6d1a7639e3fe39b3916f7b7ff5792e03acabf9..e9479f92ea8b2e7b999872eba477597a21c21f25 100644 (file)
@@ -189,7 +189,6 @@ def clientSendJob(conn, scene, anim = False):
 def requestResult(conn, job_id, frame):
     conn.request("GET", renderURL(job_id, frame))
 
-@rnaType
 class NetworkRenderEngine(bpy.types.RenderEngine):
     bl_idname = 'NET_RENDER'
     bl_label = "Network Render"
index 858ec800dbcd1729ab1eea65ded48fa32afa026e..4530491dae1603db6a8fc4ad4f373833404c4b40 100644 (file)
@@ -26,7 +26,6 @@ from netrender.utils import *
 import netrender.client as client
 import netrender.model
 
-@rnaType
 class RENDER_OT_netslave_bake(bpy.types.Operator):
     '''NEED DESCRIPTION'''
     bl_idname = "render.netslavebake"
@@ -84,7 +83,6 @@ class RENDER_OT_netslave_bake(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientanim(bpy.types.Operator):
     '''Start rendering an animation on network'''
     bl_idname = "render.netclientanim"
@@ -111,7 +109,6 @@ class RENDER_OT_netclientanim(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientrun(bpy.types.Operator):
     '''Start network rendering service'''
     bl_idname = "render.netclientstart"
@@ -128,7 +125,6 @@ class RENDER_OT_netclientrun(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientsend(bpy.types.Operator):
     '''Send Render Job to the Network'''
     bl_idname = "render.netclientsend"
@@ -158,7 +154,6 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientsendframe(bpy.types.Operator):
     '''Send Render Job with current frame to the Network'''
     bl_idname = "render.netclientsendframe"
@@ -188,7 +183,6 @@ class RENDER_OT_netclientsendframe(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientstatus(bpy.types.Operator):
     '''Refresh the status of the current jobs'''
     bl_idname = "render.netclientstatus"
@@ -228,7 +222,6 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
     '''Operator documentation text, will be used for the operator tooltip and python docs.'''
     bl_idname = "render.netclientblacklistslave"
@@ -258,7 +251,6 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
     '''Operator documentation text, will be used for the operator tooltip and python docs.'''
     bl_idname = "render.netclientwhitelistslave"
@@ -289,7 +281,6 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
         return self.execute(context)
 
 
-@rnaType
 class RENDER_OT_netclientslaves(bpy.types.Operator):
     '''Refresh status about available Render slaves'''
     bl_idname = "render.netclientslaves"
@@ -334,7 +325,6 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientcancel(bpy.types.Operator):
     '''Cancel the selected network rendering job.'''
     bl_idname = "render.netclientcancel"
@@ -363,7 +353,6 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class RENDER_OT_netclientcancelall(bpy.types.Operator):
     '''Cancel all running network rendering jobs.'''
     bl_idname = "render.netclientcancelall"
@@ -390,7 +379,6 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class netclientdownload(bpy.types.Operator):
     '''Download render results from the network'''
     bl_idname = "render.netclientdownload"
@@ -435,7 +423,6 @@ class netclientdownload(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class netclientscan(bpy.types.Operator):
     '''Listen on network for master server broadcasting its address and port.'''
     bl_idname = "render.netclientscan"
@@ -458,7 +445,6 @@ class netclientscan(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
-@rnaType
 class netclientweb(bpy.types.Operator):
     '''Open new window with information about running rendering jobs'''
     bl_idname = "render.netclientweb"
index c82a031100b28c16389e942add95118a694d61b0..594ebcd12dbd1d329d1013e982a51de9b3a0706a 100644 (file)
@@ -87,7 +87,6 @@ class RenderButtonsPanel():
         return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
 
 # Setting panel, use in the scene for now.
-@rnaType
 class RENDER_PT_network_settings(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Network Settings"
     COMPAT_ENGINES = {'NET_RENDER'}
@@ -122,7 +121,6 @@ class RENDER_PT_network_settings(bpy.types.Panel, RenderButtonsPanel):
 
         layout.operator("render.netclientweb", icon='QUESTION')
 
-@rnaType
 class RENDER_PT_network_slave_settings(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Slave Settings"
     COMPAT_ENGINES = {'NET_RENDER'}
@@ -147,7 +145,7 @@ class RENDER_PT_network_slave_settings(bpy.types.Panel, RenderButtonsPanel):
         sub = layout.column()
         sub.enabled = rd.threads_mode == 'FIXED'
         sub.prop(rd, "threads")
-@rnaType
+
 class RENDER_PT_network_master_settings(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Master Settings"
     COMPAT_ENGINES = {'NET_RENDER'}
@@ -166,7 +164,6 @@ class RENDER_PT_network_master_settings(bpy.types.Panel, RenderButtonsPanel):
         layout.prop(netsettings, "master_broadcast")
         layout.prop(netsettings, "master_clear")
 
-@rnaType
 class RENDER_PT_network_job(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Job Settings"
     COMPAT_ENGINES = {'NET_RENDER'}
@@ -207,7 +204,6 @@ class RENDER_PT_network_job(bpy.types.Panel, RenderButtonsPanel):
         row.prop(netsettings, "priority")
         row.prop(netsettings, "chunks")
 
-@rnaType
 class RENDER_PT_network_slaves(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Slaves Status"
     COMPAT_ENGINES = {'NET_RENDER'}
@@ -246,7 +242,6 @@ class RENDER_PT_network_slaves(bpy.types.Panel, RenderButtonsPanel):
             layout.label(text="Seen: " + time.ctime(slave.last_seen))
             layout.label(text="Stats: " + slave.stats)
 
-@rnaType
 class RENDER_PT_network_slaves_blacklist(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Slaves Blacklist"
     COMPAT_ENGINES = {'NET_RENDER'}
@@ -284,7 +279,6 @@ class RENDER_PT_network_slaves_blacklist(bpy.types.Panel, RenderButtonsPanel):
             layout.label(text="Seen: " + time.ctime(slave.last_seen))
             layout.label(text="Stats: " + slave.stats)
 
-@rnaType
 class RENDER_PT_network_jobs(bpy.types.Panel, RenderButtonsPanel):
     bl_label = "Jobs"
     COMPAT_ENGINES = {'NET_RENDER'}
@@ -325,15 +319,12 @@ class RENDER_PT_network_jobs(bpy.types.Panel, RenderButtonsPanel):
             layout.label(text="Done: %04i" % job.results[DONE])
             layout.label(text="Error: %04i" % job.results[ERROR])
 
-@rnaType
 class NetRenderSettings(bpy.types.IDPropertyGroup):
     pass
 
-@rnaType
 class NetRenderSlave(bpy.types.IDPropertyGroup):
     pass
 
-@rnaType
 class NetRenderJob(bpy.types.IDPropertyGroup):
     pass
 
index fa2eb6fb5f56f93517c90f302fc927e7f7115ba7..31123ce26da5abedcebb141f33ec562984c66541 100644 (file)
@@ -57,10 +57,6 @@ FRAME_STATUS_TEXT = {
         ERROR: "Error"
         }
 
-def rnaType(rna_type):
-    if bpy: bpy.types.register(rna_type)
-    return rna_type
-
 def reporting(report, message, errorType = None):
     if errorType:
         t = 'ERROR'
index 06dbe8fd4cca9c6e1a0c7f26c396095aad97a0f5..f09c5872ab1e6603661777a9388cbdb86fe80183 100644 (file)
@@ -29,6 +29,7 @@ import sys as _sys
 
 from _bpy import blend_paths
 from _bpy import script_paths as _bpy_script_paths
+from _bpy import LoadModule, UnloadModule
 
 
 def _test_import(module_name, loaded_modules):
@@ -84,7 +85,7 @@ def modules_from_path(path, loaded_modules):
             modules.append(mod)
 
     return modules
-
+            
 _loaded = [] # store loaded modules for reloading.
 _bpy_types = __import__("bpy_types") # keep for comparisons, never ever reload this.
 
@@ -108,6 +109,15 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
     if refresh_scripts:
         original_modules = _sys.modules.values()
 
+    def unload_module(mod):
+        UnloadModule(mod.__name__)
+        unregister = getattr(mod, "unregister", None)
+        if unregister:
+            try:
+                unregister()
+            except:
+                traceback.print_exc()
+                
     def sys_path_ensure(path):
         if path not in _sys.path: # reloading would add twice
             _sys.path.insert(0, path)
@@ -134,6 +144,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
             mod = test_reload(mod)
 
         if mod:
+            LoadModule(mod.__name__, reload_scripts)
             register = getattr(mod, "register", None)
             if register:
                 try:
@@ -165,12 +176,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
         # loop over and unload all scripts
         _loaded.reverse()
         for mod in _loaded:
-            unregister = getattr(mod, "unregister", None)
-            if unregister:
-                try:
-                    unregister()
-                except:
-                    traceback.print_exc()
+            unload_module(mod)
 
         for mod in _loaded:
             reload(mod)
@@ -336,7 +342,7 @@ _presets = _os.path.join(_scripts[0], "presets") # FIXME - multiple paths
 
 def preset_paths(subdir):
     '''
-    Returns a list of paths for a spesific preset.
+    Returns a list of paths for a specific preset.
     '''
 
     return (_os.path.join(_presets, subdir), )
index 8cbb2bf4e80ed8b767ff2b7d7e677a8cf2102f12..7e7b7f128abe586479ddfa7a2a8964bfc4894457 100644 (file)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 
 from _bpy import types as bpy_types
+import _bpy
 from mathutils import Vector
 
 StructRNA = bpy_types.Struct.__bases__[0]
@@ -539,8 +540,64 @@ class Text(bpy_types.ID):
 
 import collections
 
+TypeMap = {}
+# Properties (IDPropertyGroup) are different from types because they need to be registered
+# before adding sub properties to them, so they are registered on definition
+# and unregistered on unload
+PropertiesMap = {}
+
+def UnloadModule(module):
+    global TypeMap, PropertiesMap
+    for t in TypeMap.get(module, []):
+        bpy_types.unregister(t)
+        
+    TypeMap = {}
+
+    for t in PropertiesMap.get(module, []):
+        bpy_types.unregister(t)
+        
+    PropertiesMap = {}
+    
+def LoadModule(module, force=False):
+    for t in TypeMap.get(module, []):
+        bpy_types.register(t)
+
+_bpy.LoadModule = LoadModule
+_bpy.UnloadModule = UnloadModule
+
+class RNAMeta(type):
+    @classmethod
+    def _immediate(cls):
+        return bpy_types.immediate();
+    
+    def __new__(cls, name, bases, classdict, **args):
+        result = type.__new__(cls, name, bases, classdict)
+        if bases and bases[0] != StructRNA:
+            module = result.__module__
+            
+            ClassMap = TypeMap
+            
+            # Register right away if needed
+            if cls._immediate():
+                bpy_types.register(result)
+                ClassMap = PropertiesMap 
+
+            # first part of packages only
+            if "." in module:
+                module = module[:module.index(".")]
+            
+            if not module in ClassMap:
+                ClassMap[module] = []
+                
+            ClassMap[module].append(result)
+        return result
+
+class RNAMetaRegister(RNAMeta):
+    @classmethod
+    def _immediate(cls):
+        return True;
 
-class OrderedMeta(type):
+class OrderedMeta(RNAMeta):
 
     def __init__(cls, name, bases, attributes):
         super(OrderedMeta, cls).__init__(name, bases, attributes)
@@ -549,7 +606,6 @@ class OrderedMeta(type):
     def __prepare__(name, bases, **kwargs):
         return collections.OrderedDict()
 
-
 # Only defined so operators members can be used by accessing self.order
 class Operator(StructRNA, metaclass=OrderedMeta):
     __slots__ = ()
@@ -564,7 +620,12 @@ class Macro(StructRNA, metaclass=OrderedMeta):
     def define(self, opname):
         from _bpy import ops
         return ops.macro_define(self, opname)
+    
+class IDPropertyGroup(StructRNA, metaclass=RNAMetaRegister):
+        __slots__ = ()
 
+class RenderEngine(StructRNA, metaclass=RNAMeta):
+    __slots__ = ()
 
 class _GenericUI:
     __slots__ = ()
@@ -606,15 +667,15 @@ class _GenericUI:
             pass
 
 
-class Panel(StructRNA, _GenericUI):
+class Panel(StructRNA, _GenericUI, metaclass=RNAMeta):
     __slots__ = ()
 
 
-class Header(StructRNA, _GenericUI):
+class Header(StructRNA, _GenericUI, metaclass=RNAMeta):
     __slots__ = ()
 
 
-class Menu(StructRNA, _GenericUI):
+class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
     __slots__ = ()
 
     def path_menu(self, searchpaths, operator, props_default={}):
index 3e8662c275f78c53045928594ecf5125b0eaf0c2..eda27240fb5134893654b0810ff6168d93349ee2 100644 (file)
@@ -124,7 +124,7 @@ def draw(layout, context, context_member, use_edit=True):
             assign_props(prop, val_draw, key)
 
 
-class PropertyPanel(bpy.types.Panel):
+class PropertyPanel():
     """
     The subclass should have its own poll function
     and the variable '_context_path' MUST be set.
@@ -135,130 +135,3 @@ class PropertyPanel(bpy.types.Panel):
     def draw(self, context):
         draw(self.layout, context, self._context_path)
 
-
-from bpy.props import *
-
-
-rna_path = StringProperty(name="Property Edit",
-    description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'})
-
-rna_value = StringProperty(name="Property Value",
-    description="Property value edit", maxlen=1024, default="")
-
-rna_property = StringProperty(name="Property Name",
-    description="Property name edit", maxlen=1024, default="")
-
-rna_min = FloatProperty(name="Min", default=0.0, precision=3)
-rna_max = FloatProperty(name="Max", default=1.0, precision=3)
-
-
-class WM_OT_properties_edit(bpy.types.Operator):
-    '''Internal use (edit a property data_path)'''
-    bl_idname = "wm.properties_edit"
-    bl_label = "Edit Property"
-
-    data_path = rna_path
-    property = rna_property
-    value = rna_value
-    min = rna_min
-    max = rna_max
-    description = StringProperty(name="Tip", default="")
-
-    def execute(self, context):
-        data_path = self.properties.data_path
-        value = self.properties.value
-        prop = self.properties.property
-        prop_old = self._last_prop[0]
-
-        try:
-            value_eval = eval(value)
-        except:
-            value_eval = value
-
-        # First remove
-        item = eval("context.%s" % data_path)
-
-        rna_idprop_ui_prop_clear(item, prop_old)
-        exec_str = "del item['%s']" % prop_old
-        # print(exec_str)
-        exec(exec_str)
-
-
-        # Reassign
-        exec_str = "item['%s'] = %s" % (prop, repr(value_eval))
-        # print(exec_str)
-        exec(exec_str)
-        self._last_prop[:] = [prop]
-
-        prop_type = type(item[prop])
-
-        prop_ui = rna_idprop_ui_prop_get(item, prop)
-
-        if prop_type in (float, int):
-
-            prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.properties.min)
-            prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.properties.max)
-
-        prop_ui['description'] = self.properties.description
-
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-
-        self._last_prop = [self.properties.property]
-
-        item = eval("context.%s" % self.properties.data_path)
-
-        # setup defaults
-        prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create
-        if prop_ui:
-            self.properties.min = prop_ui.get("min", -1000000000)
-            self.properties.max = prop_ui.get("max", 1000000000)
-            self.properties.description = prop_ui.get("description", "")
-
-        wm = context.manager
-        # This crashes, TODO - fix
-        #return wm.invoke_props_popup(self, event)
-
-        wm.invoke_props_popup(self, event)
-        return {'RUNNING_MODAL'}
-
-
-class WM_OT_properties_add(bpy.types.Operator):
-    '''Internal use (edit a property data_path)'''
-    bl_idname = "wm.properties_add"
-    bl_label = "Add Property"
-
-    data_path = rna_path
-
-    def execute(self, context):
-        item = eval("context.%s" % self.properties.data_path)
-
-        def unique_name(names):
-            prop = 'prop'
-            prop_new = prop
-            i = 1
-            while prop_new in names:
-                prop_new = prop + str(i)
-                i += 1
-
-            return prop_new
-
-        property = unique_name(item.keys())
-
-        item[property] = 1.0
-        return {'FINISHED'}
-
-
-class WM_OT_properties_remove(bpy.types.Operator):
-    '''Internal use (edit a property data_path)'''
-    bl_idname = "wm.properties_remove"
-    bl_label = "Remove Property"
-
-    data_path = rna_path
-    property = rna_property
-
-    def execute(self, context):
-        item = eval("context.%s" % self.properties.data_path)
-        del item[self.properties.property]
-        return {'FINISHED'}
index 164bbfb100bea7252226bc246a48c3984ea5ba9e..5d6ec1f559fa9a441433eed503534c0f0f4a715e 100644 (file)
@@ -606,12 +606,10 @@ menu_func = (lambda self, context: self.layout.operator(AddHuman.bl_idname,
 
 
 def register():
-    bpy.types.register(AddHuman)
     bpy.types.INFO_MT_armature_add.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(AddHuman)
     bpy.types.INFO_MT_armature_add.remove(menu_func)
 
 if __name__ == "__main__":
index 16bf4e1c92c6f9093dffc6cf8a69fcd9f25fe098..d64b92a8b19322e41759cae4c20b6d731720154c 100644 (file)
@@ -137,12 +137,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(AddTorus)
     bpy.types.INFO_MT_mesh_add.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(AddTorus)
     bpy.types.INFO_MT_mesh_add.remove(menu_func)
 
 if __name__ == "__main__":
index 39c226294ee68d82012680eaab35193cc2e102e1..11431c52eb66e981f26cb87f5f7150d27850bb4b 100644 (file)
@@ -56,10 +56,10 @@ class DiscontFilterOp(bpy.types.Operator):
         return {'FINISHED'}
 
 def register():
-    bpy.types.register(DiscontFilterOp)
+    pass
 
 def unregister():
-    bpy.types.unregister(DiscontFilterOp)
+    pass
 
 if __name__ == "__main__":
     register()
index be583012d7a4a6000afa7de1bd3934a7f3713e8d..bcef8b9afd35f00bad6cc7656d931b65e787e700 100644 (file)
@@ -186,23 +186,12 @@ class ProjectApply(bpy.types.Operator):
 
         return {'FINISHED'}
 
-classes = [
-    EditExternally,
-    SaveDirty,
-    ProjectEdit,
-    ProjectApply]
-
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
-
+    pass
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index b63997b8eba3dba5fb286f7292fe1df268b42200..ee3e93c58c46f3fd2205d5d4d03d53e545695774 100644 (file)
@@ -172,22 +172,12 @@ class MeshMirrorUV(bpy.types.Operator):
         return {'FINISHED'}
 
 
-# Register the operator
-classes = [
-    MeshSelectInteriorFaces,
-    MeshMirrorUV]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index ceb4621d643b3895a76225e0ac8d423b7ba72117..bec5f5b3909ab6c7c0cb660d7ce61c6e283151a7 100644 (file)
@@ -178,12 +178,12 @@ class BakeAction(bpy.types.Operator):
 
 
 def register():
-    bpy.types.register(BakeAction)
+    pass
     # bpy.types.INFO_MT_mesh_add.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(BakeAction)
+    pass
     # bpy.types.INFO_MT_mesh_add.remove(menu_func)
 
 if __name__ == "__main__":
index 403491bfa28fde860565017da4ad93d7cf52371e..8d9280e43afe0430c1f349910ac931c757267aef 100644 (file)
@@ -558,28 +558,12 @@ class ClearAllRestrictRender(bpy.types.Operator):
         return {'FINISHED'}
 
 
-classes = [
-    SelectPattern,
-    SelectCamera,
-    SelectHierarchy,
-    SubdivisionSet,
-    ShapeTransfer,
-    JoinUVs,
-    IsolateTypeRender,
-    MakeDupliFace,
-    ClearAllRestrictRender]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
\ No newline at end of file
index 6e5eef0fbc289a66fb8db1847e77062a5083663a..39b642c1b9f41b664ec96ceb341c77ac192fcf37 100644 (file)
@@ -286,12 +286,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(AlignObjects)
     bpy.types.VIEW3D_MT_transform.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(AlignObjects)
     bpy.types.VIEW3D_MT_transform.remove(menu_func)
 
 if __name__ == "__main__":
index 89884b1767f59f7b66d0dfb4443b994a878cb9b8..8c3f4eb6dfdcd45b017f20f764bc7c7af7c84d55 100644 (file)
@@ -140,12 +140,10 @@ def menu_func(self, context):
 
 
 def register():
-    bpy.types.register(RandomizeLocRotSize)
     bpy.types.VIEW3D_MT_transform.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(RandomizeLocRotSize)
     bpy.types.VIEW3D_MT_transform.remove(menu_func)
 
 if __name__ == "__main__":
index f80c5e69ddd2be15eee5af3afdc9a152c71c8af5..2012ba913fbf3654a45f44328991bab15ff84da7 100644 (file)
@@ -22,7 +22,7 @@ import bpy
 import os
 
 
-class AddPresetBase(bpy.types.Operator):
+class AddPresetBase():
     '''Base preset class, only for subclassing
     subclasses must define
      - preset_values
@@ -91,7 +91,7 @@ class ExecutePreset(bpy.types.Operator):
         return {'FINISHED'}
 
 
-class AddPresetRender(AddPresetBase):
+class AddPresetRender(AddPresetBase, bpy.types.Operator):
     '''Add a Render Preset'''
     bl_idname = "render.preset_add"
     bl_label = "Add Render Preset"
@@ -113,7 +113,7 @@ class AddPresetRender(AddPresetBase):
     preset_subdir = "render"
 
 
-class AddPresetSSS(AddPresetBase):
+class AddPresetSSS(AddPresetBase, bpy.types.Operator):
     '''Add a Subsurface Scattering Preset'''
     bl_idname = "material.sss_preset_add"
     bl_label = "Add SSS Preset"
@@ -138,7 +138,7 @@ class AddPresetSSS(AddPresetBase):
     preset_subdir = "sss"
 
 
-class AddPresetCloth(AddPresetBase):
+class AddPresetCloth(AddPresetBase, bpy.types.Operator):
     '''Add a Cloth Preset'''
     bl_idname = "cloth.preset_add"
     bl_label = "Add Cloth Preset"
@@ -156,7 +156,7 @@ class AddPresetCloth(AddPresetBase):
     preset_subdir = "cloth"
 
 
-class AddPresetSunSky(AddPresetBase):
+class AddPresetSunSky(AddPresetBase, bpy.types.Operator):
     '''Add a Sky & Atmosphere Preset'''
     bl_idname = "lamp.sunsky_preset_add"
     bl_label = "Add Sunsky Preset"
@@ -181,7 +181,7 @@ class AddPresetSunSky(AddPresetBase):
     preset_subdir = "sunsky"
 
 
-class AddPresetInteraction(AddPresetBase):
+class AddPresetInteraction(AddPresetBase, bpy.types.Operator):
     '''Add an Application Interaction Preset'''
     bl_idname = "wm.interaction_preset_add"
     bl_label = "Add Interaction Preset"
@@ -203,25 +203,12 @@ class AddPresetInteraction(AddPresetBase):
 
     preset_subdir = "interaction"
 
-classes = [
-    ExecutePreset,
-    AddPresetRender,
-    AddPresetSSS,
-    AddPresetCloth,
-    AddPresetSunSky,
-    AddPresetInteraction]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 2ecd445df1d02eb3a1603ee39a5836779bf4f507..7893ce0ff3eaedab8350069430a51c2ff7eb7c9c 100644 (file)
@@ -144,11 +144,11 @@ class PlayRenderedAnim(bpy.types.Operator):
 
 
 def register():
-    bpy.types.register(PlayRenderedAnim)
+    pass
 
 
 def unregister():
-    bpy.types.unregister(PlayRenderedAnim)
+    pass
 
 if __name__ == "__main__":
     register()
index 432486b70cf71dfe59dbf5f9f1ef7d11357d2504..e01f2dcb23a23779380542aa4316c2922762ef14 100644 (file)
@@ -132,19 +132,11 @@ class SequencerDeinterlaceSelectedMovies(bpy.types.Operator):
 
 
 def register():
-    register = bpy.types.register
-
-    register(SequencerCrossfadeSounds)
-    register(SequencerCutMulticam)
-    register(SequencerDeinterlaceSelectedMovies)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-
-    unregister(SequencerCrossfadeSounds)
-    unregister(SequencerCutMulticam)
-    unregister(SequencerDeinterlaceSelectedMovies)
+    pass
 
 
 if __name__ == "__main__":
index a7abd475b8d3295a6d9cd2087dbcaa9c79717472..23e06c968cda3d619f87effdb420c0f9dd22e47b 100644 (file)
@@ -216,12 +216,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__":
index 6466d48a9fee539898547338ca8c15558777d2d3..6f337bd623d48680f8cdaecabfb4559adc68dba6 100644 (file)
@@ -263,12 +263,10 @@ menu_func = (lambda self, context: self.layout.operator(FollowActiveQuads.bl_idn
 
 
 def register():
-    bpy.types.register(FollowActiveQuads)
     bpy.types.VIEW3D_MT_uv_map.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(FollowActiveQuads)
     bpy.types.VIEW3D_MT_uv_map.remove(menu_func)
 
 if __name__ == "__main__":
index 78cef26f78c9bc3976896be65665ad24d4efc435..637dccda4ba4217d8e57565f2ae17c0f90da1e07 100644 (file)
@@ -1138,12 +1138,10 @@ menu_func = (lambda self, context: self.layout.operator(SmartProject.bl_idname,
 
 
 def register():
-    bpy.types.register(SmartProject)
     bpy.types.VIEW3D_MT_uv_map.append(menu_func)
 
 
 def unregister():
-    bpy.types.unregister(SmartProject)
     bpy.types.VIEW3D_MT_uv_map.remove(menu_func)
 
 if __name__ == "__main__":
index 63a3aa3896b63e043bebaf4562aa8f0425b7e543..21c19d528ccec34bed1a61f42f3c88523f4b31fd 100644 (file)
@@ -180,11 +180,11 @@ class VertexPaintDirt(bpy.types.Operator):
 
 
 def register():
-    bpy.types.register(VertexPaintDirt)
+    pass
 
 
 def unregister():
-    bpy.types.unregister(VertexPaintDirt)
+    pass
 
 if __name__ == "__main__":
     register()
index ed77f32ff6d7deb4f5034a19fb4c0ee2cff665a6..0cd68cf63681e95ff458b453e3eb5ecd2cc622c7 100644 (file)
@@ -576,46 +576,139 @@ class WM_OT_doc_edit(bpy.types.Operator):
         return wm.invoke_props_dialog(self, width=600)
 
 
-import rna_prop_ui
+from bpy.props import *
+
+
+rna_path = StringProperty(name="Property Edit",
+    description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'})
+
+rna_value = StringProperty(name="Property Value",
+    description="Property value edit", maxlen=1024, default="")
+
+rna_property = StringProperty(name="Property Name",
+    description="Property name edit", maxlen=1024, default="")
+
+rna_min = FloatProperty(name="Min", default=0.0, precision=3)
+rna_max = FloatProperty(name="Max", default=1.0, precision=3)
+
+
+class WM_OT_properties_edit(bpy.types.Operator):
+    '''Internal use (edit a property data_path)'''
+    bl_idname = "wm.properties_edit"
+    bl_label = "Edit Property"
+
+    data_path = rna_path
+    property = rna_property
+    value = rna_value
+    min = rna_min
+    max = rna_max
+    description = StringProperty(name="Tip", default="")
+
+    def execute(self, context):
+        data_path = self.properties.data_path
+        value = self.properties.value
+        prop = self.properties.property
+        prop_old = self._last_prop[0]
+
+        try:
+            value_eval = eval(value)
+        except:
+            value_eval = value
+
+        # First remove
+        item = eval("context.%s" % data_path)
+
+        rna_idprop_ui_prop_clear(item, prop_old)
+        exec_str = "del item['%s']" % prop_old
+        # print(exec_str)
+        exec(exec_str)
+
+
+        # Reassign
+        exec_str = "item['%s'] = %s" % (prop, repr(value_eval))
+        # print(exec_str)
+        exec(exec_str)
+        self._last_prop[:] = [prop]
+
+        prop_type = type(item[prop])
+
+        prop_ui = rna_idprop_ui_prop_get(item, prop)
+
+        if prop_type in (float, int):
+
+            prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.properties.min)
+            prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.properties.max)
 
-classes = [
-    MESH_OT_delete_edgeloop,
+        prop_ui['description'] = self.properties.description
+
+        return {'FINISHED'}
+
+    def invoke(self, context, event):
+
+        self._last_prop = [self.properties.property]
+
+        item = eval("context.%s" % self.properties.data_path)
+
+        # setup defaults
+        prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create
+        if prop_ui:
+            self.properties.min = prop_ui.get("min", -1000000000)
+            self.properties.max = prop_ui.get("max", 1000000000)
+            self.properties.description = prop_ui.get("description", "")
+
+        wm = context.manager
+        # This crashes, TODO - fix
+        #return wm.invoke_props_popup(self, event)
+
+        wm.invoke_props_popup(self, event)
+        return {'RUNNING_MODAL'}
 
-    WM_OT_context_set_boolean,
-    WM_OT_context_set_int,
-    WM_OT_context_scale_int,
-    WM_OT_context_set_float,
-    WM_OT_context_set_string,
-    WM_OT_context_set_enum,
-    WM_OT_context_set_value,
-    WM_OT_context_toggle,
-    WM_OT_context_toggle_enum,
-    WM_OT_context_cycle_enum,
-    WM_OT_context_cycle_int,
-    WM_OT_context_modal_mouse,
 
-    WM_OT_url_open,
-    WM_OT_path_open,
+class WM_OT_properties_add(bpy.types.Operator):
+    '''Internal use (edit a property data_path)'''
+    bl_idname = "wm.properties_add"
+    bl_label = "Add Property"
 
-    WM_OT_doc_view,
-    WM_OT_doc_edit,
+    data_path = rna_path
 
-    # experemental!
-    rna_prop_ui.WM_OT_properties_edit,
-    rna_prop_ui.WM_OT_properties_add,
-    rna_prop_ui.WM_OT_properties_remove]
+    def execute(self, context):
+        item = eval("context.%s" % self.properties.data_path)
+
+        def unique_name(names):
+            prop = 'prop'
+            prop_new = prop
+            i = 1
+            while prop_new in names:
+                prop_new = prop + str(i)
+                i += 1
+
+            return prop_new
+
+        property = unique_name(item.keys())
+
+        item[property] = 1.0
+        return {'FINISHED'}
 
 
+class WM_OT_properties_remove(bpy.types.Operator):
+    '''Internal use (edit a property data_path)'''
+    bl_idname = "wm.properties_remove"
+    bl_label = "Remove Property"
+
+    data_path = rna_path
+    property = rna_property
+
+    def execute(self, context):
+        item = eval("context.%s" % self.properties.data_path)
+        del item[self.properties.property]
+        return {'FINISHED'}
+
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index e20b92c9b6a48066fd6106ee3438f774e56f030e..038e76bd6d36adaaf1d1489c0e1ad2fe1dce091a 100644 (file)
@@ -55,7 +55,6 @@ class ExportSomeData(bpy.types.Operator):
 
 
 
-bpy.types.register(ExportSomeData)
 
 # 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...")
index 985a628c2d01869d5c1166390a8357dd26c3053b..739c1aa7d26b2aa6bd9fbbed93d5366ce99de3bf 100644 (file)
@@ -17,10 +17,10 @@ class SimpleOperator(bpy.types.Operator):
         return {'FINISHED'}
 
 def register():
-    bpy.types.register(SimpleOperator)
+    pass
 
 def unregister():
-    bpy.types.unregister(SimpleOperator)
+    pass
 
 if __name__ == "__main__":
     register()
index 9327de33312e2648ebfc6e4e4e81723aa0c3f236..395b0bb3f24d0f0de708ef862ab95da970ce5852 100644 (file)
@@ -37,7 +37,6 @@ class UvOperator(bpy.types.Operator):
         main(context)
         return {'FINISHED'}
 
-bpy.types.register(UvOperator)
 
 if __name__ == "__main__":
     bpy.ops.uv.simple_operator()
index aac4b6e715eb97167e6e49eb66c6996b26512fec..531f9f1a106a7edfb4d5afe21b0eb13a5412047b 100644 (file)
@@ -19,4 +19,3 @@ class OBJECT_PT_hello(bpy.types.Panel):
         row = layout.row()
         row.prop(obj, "name")
 
-bpy.types.register(OBJECT_PT_hello)
index 9eb046cc2c888c1a7ea0be42fbc6ce155cc9c5d3..e15b7354cee3d0a05e77485f9ebdf0ca5a4aa904 100644 (file)
@@ -25,7 +25,7 @@ narrowui = bpy.context.user_preferences.view.properties_width_check
 # Generic Panels (Independent of DataType)
 
 
-class MotionPathButtonsPanel(bpy.types.Panel):
+class MotionPathButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_label = "Motion Paths"
@@ -67,7 +67,7 @@ class MotionPathButtonsPanel(bpy.types.Panel):
 
 
 # FIXME: this panel still needs to be ported so that it will work correctly with animviz
-class OnionSkinButtonsPanel(bpy.types.Panel):
+class OnionSkinButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_label = "Onion Skinning"
@@ -102,119 +102,19 @@ class OnionSkinButtonsPanel(bpy.types.Panel):
         col.label(text="Display:")
         col.prop(arm, "ghost_only_selected", text="Selected Only")
 
-################################################
-# Specific Panels for DataTypes
-
-
-class OBJECT_PT_motion_paths(MotionPathButtonsPanel):
-    #bl_label = "Object Motion Paths"
-    bl_context = "object"
-
-    def poll(self, context):
-        return (context.object)
-
-    def draw(self, context):
-        layout = self.layout
-
-        ob = context.object
-        wide_ui = context.region.width > narrowui
-
-        self.draw_settings(context, ob.animation_visualisation, wide_ui)
-
-        layout.separator()
-
-        split = layout.split()
-
-        col = split.column()
-        col.operator("object.paths_calculate", text="Calculate Paths")
-
-        if wide_ui:
-            col = split.column()
-        col.operator("object.paths_clear", text="Clear Paths")
-
-
-class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel):
-    #bl_label = "Object Onion Skinning"
-    bl_context = "object"
-
-    def poll(self, context):
-        return (context.object)
-
-    def draw(self, context):
-        layout = self.layout
-
-        ob = context.object
-        wide_ui = context.region.width > narrowui
-
-        self.draw_settings(context, ob.animation_visualisation, wide_ui)
 
 
-class DATA_PT_motion_paths(MotionPathButtonsPanel):
-    #bl_label = "Bones Motion Paths"
-    bl_context = "data"
-
-    def poll(self, context):
-        # XXX: include posemode check?
-        return (context.object) and (context.armature)
-
-    def draw(self, context):
-        layout = self.layout
-
-        ob = context.object
-        wide_ui = context.region.width > narrowui
-
-        self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
-
-        layout.separator()
-
-        split = layout.split()
-
-        col = split.column()
-        col.operator("pose.paths_calculate", text="Calculate Paths")
-
-        if wide_ui:
-            col = split.column()
-        col.operator("pose.paths_clear", text="Clear Paths")
-
-
-class DATA_PT_onion_skinning(OnionSkinButtonsPanel):
-    #bl_label = "Bones Onion Skinning"
-    bl_context = "data"
-
-    def poll(self, context):
-        # XXX: include posemode check?
-        return (context.object) and (context.armature)
-
-    def draw(self, context):
-        layout = self.layout
-
-        ob = context.object
-        wide_ui = context.region.width > narrowui
-
-        self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
-
 # NOTE:
-# The specialised panel types defined here (i.e. OBJECT_PT_*, etc.)
-# aren't registered here, but are rather imported to (and registered)
-# in the files defining the contexts where they reside. Otherwise,
-# these panels appear at the top of the lists by default.
-#
-# However, we keep these empty register funcs here just in case
-# something will need them again one day, and also to make
-# it easier to maintain these scripts.
-classes = []
+# The specialised panel types are derived in their respective UI modules
+
 
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 31ede4adfb5dc667cf7f674ea86ea61b5d2a850b..f32cbe9716525b7be83c7b3a4eea77aff88adf32 100644 (file)
@@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -32,7 +32,7 @@ class DataButtonsPanel(bpy.types.Panel):
         return context.armature
 
 
-class DATA_PT_context_arm(DataButtonsPanel):
+class DATA_PT_context_arm(DataButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
 
@@ -56,11 +56,11 @@ class DATA_PT_context_arm(DataButtonsPanel):
             layout.template_ID(ob, "data")
 
 
-class DATA_PT_custom_props_arm(DataButtonsPanel, PropertyPanel):
+class DATA_PT_custom_props_arm(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "object.data"
 
 
-class DATA_PT_skeleton(DataButtonsPanel):
+class DATA_PT_skeleton(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Skeleton"
 
     def draw(self, context):
@@ -95,7 +95,7 @@ class DATA_PT_skeleton(DataButtonsPanel):
         col.prop(arm, "deform_quaternion", text="Quaternion")
 
 
-class DATA_PT_display(DataButtonsPanel):
+class DATA_PT_display(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Display"
 
     def draw(self, context):
@@ -124,7 +124,7 @@ class DATA_PT_display(DataButtonsPanel):
         col.prop(arm, "delay_deform", text="Delay Refresh")
 
 
-class DATA_PT_bone_groups(DataButtonsPanel):
+class DATA_PT_bone_groups(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Bone Groups"
 
     def poll(self, context):
@@ -174,7 +174,7 @@ class DATA_PT_bone_groups(DataButtonsPanel):
 
 
 # TODO: this panel will soon be depreceated too
-class DATA_PT_ghost(DataButtonsPanel):
+class DATA_PT_ghost(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Ghost"
 
     def draw(self, context):
@@ -207,7 +207,7 @@ class DATA_PT_ghost(DataButtonsPanel):
         col.prop(arm, "ghost_only_selected", text="Selected Only")
 
 
-class DATA_PT_iksolver_itasc(DataButtonsPanel):
+class DATA_PT_iksolver_itasc(DataButtonsPanel, bpy.types.Panel):
     bl_label = "iTaSC parameters"
     bl_default_closed = True
 
@@ -261,33 +261,58 @@ class DATA_PT_iksolver_itasc(DataButtonsPanel):
                 row.prop(itasc, "dampmax", text="Damp", slider=True)
                 row.prop(itasc, "dampeps", text="Eps", slider=True)
 
-# import generic panels from other files
-from properties_animviz import DATA_PT_motion_paths, DATA_PT_onion_skinning
+from properties_animviz import MotionPathButtonsPanel, OnionSkinButtonsPanel
 
-classes = [
-    DATA_PT_context_arm,
-    DATA_PT_skeleton,
-    DATA_PT_display,
-    DATA_PT_bone_groups,
-    DATA_PT_ghost,
-    DATA_PT_iksolver_itasc,
+class DATA_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
+    #bl_label = "Bones Motion Paths"
+    bl_context = "data"
+
+    def poll(self, context):
+        # XXX: include posemode check?
+        return (context.object) and (context.armature)
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        wide_ui = context.region.width > narrowui
+
+        self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
+
+        layout.separator()
 
-    DATA_PT_motion_paths,
-    #DATA_PT_onion_skinning,
+        split = layout.split()
+
+        col = split.column()
+        col.operator("pose.paths_calculate", text="Calculate Paths")
 
-    DATA_PT_custom_props_arm]
+        if wide_ui:
+            col = split.column()
+        col.operator("pose.paths_clear", text="Clear Paths")
+
+
+class DATA_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # inherit from panel when ready
+    #bl_label = "Bones Onion Skinning"
+    bl_context = "data"
+
+    def poll(self, context):
+        # XXX: include posemode check?
+        return (context.object) and (context.armature)
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        wide_ui = context.region.width > narrowui
 
+        self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 5af676d5aa8bea47e845d1b07718d04989d3af3d..8331f2d517b837f17c6502b334536376a965b503 100644 (file)
@@ -307,33 +307,11 @@ class INFO_MT_armature_metarig_add(bpy.types.Menu):
             text = bpy.utils.display_name(submodule_type)
             layout.operator("pose.metarig_sample_add", text=text, icon='OUTLINER_OB_ARMATURE').metarig_type = submodule_type
 
-classes = [
-    DATA_PT_template,
-
-    PoseTemplateSettings,
-    PoseTemplate,
-
-    Reload,
-    Generate,
-    Validate,
-    Sample,
-    Graph,
-    AsScript,
-
-    ActiveAssign,
-    ActiveClear,
-
-    INFO_MT_armature_metarig_add]
-
 menu_func = (lambda self, context: self.layout.menu("INFO_MT_armature_metarig_add", icon='OUTLINER_OB_ARMATURE'))
 import space_info # ensure the menu is loaded first
 
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
-
     PoseTemplate.StringProperty(attr="name",
                     name="Name of the slave",
                     description="",
@@ -361,10 +339,6 @@ def register():
 
 def unregister():
     bpy.types.Scene.RemoveProperty("pose_templates")
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
-
     space_info.INFO_MT_armature_add.remove(menu_func)
 
 if __name__ == "__main__":
index a4be7b31042744cd0d6b81ddc43e29b6988e965e..d68253aac4d1e6cde7c0dfe1e2a4a3f5935a1995 100644 (file)
@@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class BoneButtonsPanel(bpy.types.Panel):
+class BoneButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "bone"
@@ -32,7 +32,7 @@ class BoneButtonsPanel(bpy.types.Panel):
         return (context.bone or context.edit_bone)
 
 
-class BONE_PT_context_bone(BoneButtonsPanel):
+class BONE_PT_context_bone(BoneButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
 
@@ -48,7 +48,7 @@ class BONE_PT_context_bone(BoneButtonsPanel):
         row.prop(bone, "name", text="")
 
 
-class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel):
+class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, bpy.types.Panel):
 
     @property
     def _context_path(self):
@@ -59,7 +59,7 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel):
             return "active_bone"
 
 
-class BONE_PT_transform(BoneButtonsPanel):
+class BONE_PT_transform(BoneButtonsPanel, bpy.types.Panel):
     bl_label = "Transform"
 
     def draw(self, context):
@@ -128,7 +128,7 @@ class BONE_PT_transform(BoneButtonsPanel):
                 col.prop(pchan, "scale")
 
 
-class BONE_PT_transform_locks(BoneButtonsPanel):
+class BONE_PT_transform_locks(BoneButtonsPanel, bpy.types.Panel):
     bl_label = "Transform Locks"
     bl_default_closed = True
 
@@ -159,7 +159,7 @@ class BONE_PT_transform_locks(BoneButtonsPanel):
         row.column().prop(pchan, "lock_scale")
 
 
-class BONE_PT_relations(BoneButtonsPanel):
+class BONE_PT_relations(BoneButtonsPanel, bpy.types.Panel):
     bl_label = "Relations"
 
     def draw(self, context):
@@ -206,7 +206,7 @@ class BONE_PT_relations(BoneButtonsPanel):
         sub.prop(bone, "local_location", text="Local Location")
 
 
-class BONE_PT_display(BoneButtonsPanel):
+class BONE_PT_display(BoneButtonsPanel, bpy.types.Panel):
     bl_label = "Display"
 
     def poll(self, context):
@@ -242,7 +242,7 @@ class BONE_PT_display(BoneButtonsPanel):
                 col.prop_object(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
 
 
-class BONE_PT_inverse_kinematics(BoneButtonsPanel):
+class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
     bl_label = "Inverse Kinematics"
     bl_default_closed = True
 
@@ -340,7 +340,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel):
             #row.prop(pchan, "ik_lin_weight", text="Weight", slider=True)
 
 
-class BONE_PT_deform(BoneButtonsPanel):
+class BONE_PT_deform(BoneButtonsPanel, bpy.types.Panel):
     bl_label = "Deform"
     bl_default_closed = True
 
@@ -390,28 +390,13 @@ class BONE_PT_deform(BoneButtonsPanel):
         col.label(text="Offset:")
         col.prop(bone, "cyclic_offset")
 
-classes = [
-    BONE_PT_context_bone,
-    BONE_PT_transform,
-    BONE_PT_transform_locks,
-    BONE_PT_relations,
-    BONE_PT_display,
-    BONE_PT_inverse_kinematics,
-    BONE_PT_deform,
-
-    BONE_PT_custom_props]
-
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 3abd460c4277114a6270c11e5e41b08ed51376f2..5152e004f2842ee1c113a1832bf60aa74719fc8b 100644 (file)
@@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -33,7 +33,7 @@ class DataButtonsPanel(bpy.types.Panel):
         return context.camera and (engine in self.COMPAT_ENGINES)
 
 
-class DATA_PT_context_camera(DataButtonsPanel):
+class DATA_PT_context_camera(DataButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -61,12 +61,12 @@ class DATA_PT_context_camera(DataButtonsPanel):
                 layout.template_ID(space, "pin_id")
 
 
-class DATA_PT_custom_props_camera(DataButtonsPanel, PropertyPanel):
+class DATA_PT_custom_props_camera(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "object.data"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
 
-class DATA_PT_camera(DataButtonsPanel):
+class DATA_PT_camera(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Lens"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -127,7 +127,7 @@ class DATA_PT_camera(DataButtonsPanel):
         col.prop(cam, "dof_distance", text="Distance")
 
 
-class DATA_PT_camera_display(DataButtonsPanel):
+class DATA_PT_camera_display(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Display"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -155,24 +155,12 @@ class DATA_PT_camera_display(DataButtonsPanel):
         sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
 
 
-classes = [
-    DATA_PT_context_camera,
-    DATA_PT_camera,
-    DATA_PT_camera_display,
-
-    DATA_PT_custom_props_camera]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index fd836f5e5d49239ce0398659d97ad08b99e6a757..279301ae330be0818fa97569a2038dcbb2f61efe 100644 (file)
@@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -47,7 +47,7 @@ class DataButtonsPanelActive(DataButtonsPanel):
         return (curve and type(curve) is not bpy.types.TextCurve and curve.splines.active)
 
 
-class DATA_PT_context_curve(DataButtonsPanel):
+class DATA_PT_context_curve(DataButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
 
@@ -73,11 +73,11 @@ class DATA_PT_context_curve(DataButtonsPanel):
             layout.template_ID(ob, "data")
 
 
-class DATA_PT_custom_props_curve(DataButtonsPanel, PropertyPanel):
+class DATA_PT_custom_props_curve(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "object.data"
 
 
-class DATA_PT_shape_curve(DataButtonsPanel):
+class DATA_PT_shape_curve(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Shape"
 
     def draw(self, context):
@@ -130,7 +130,7 @@ class DATA_PT_shape_curve(DataButtonsPanel):
         col.prop(curve, "auto_texspace")
 
 
-class DATA_PT_geometry_curve(DataButtonsPanel):
+class DATA_PT_geometry_curve(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Geometry"
 
     def poll(self, context):
@@ -164,7 +164,7 @@ class DATA_PT_geometry_curve(DataButtonsPanel):
         col.prop(curve, "bevel_object", text="")
 
 
-class DATA_PT_pathanim(DataButtonsPanelCurve):
+class DATA_PT_pathanim(DataButtonsPanelCurve, bpy.types.Panel):
     bl_label = "Path Animation"
 
     def draw_header(self, context):
@@ -196,7 +196,7 @@ class DATA_PT_pathanim(DataButtonsPanelCurve):
         col.prop(curve, "use_time_offset", text="Offset Children")
 
 
-class DATA_PT_active_spline(DataButtonsPanelActive):
+class DATA_PT_active_spline(DataButtonsPanelActive, bpy.types.Panel):
     bl_label = "Active Spline"
 
     def draw(self, context):
@@ -267,7 +267,7 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
             layout.prop(act_spline, "smooth")
 
 
-class DATA_PT_font(DataButtonsPanel):
+class DATA_PT_font(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Font"
 
     def poll(self, context):
@@ -329,7 +329,7 @@ class DATA_PT_font(DataButtonsPanel):
         col.prop(char, "use_small_caps")
 
 
-class DATA_PT_paragraph(DataButtonsPanel):
+class DATA_PT_paragraph(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Paragraph"
 
     def poll(self, context):
@@ -362,7 +362,7 @@ class DATA_PT_paragraph(DataButtonsPanel):
         col.prop(text, "offset_y", text="Y")
 
 
-class DATA_PT_textboxes(DataButtonsPanel):
+class DATA_PT_textboxes(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Text Boxes"
 
     def poll(self, context):
@@ -404,29 +404,12 @@ class DATA_PT_textboxes(DataButtonsPanel):
             row.operator("font.textbox_remove", text='', icon='X', emboss=False).index = i
 
 
-classes = [
-    DATA_PT_context_curve,
-    DATA_PT_shape_curve,
-    DATA_PT_geometry_curve,
-    DATA_PT_pathanim,
-    DATA_PT_active_spline,
-    DATA_PT_font,
-    DATA_PT_paragraph,
-    DATA_PT_textboxes,
-
-    DATA_PT_custom_props_curve]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 577e32ed8400f452216687e9fb9f7c56902e86a2..0a246f237a8d0e8e76e646ab9bfc603f7c8d3412 100644 (file)
@@ -22,7 +22,7 @@ import bpy
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -31,7 +31,7 @@ class DataButtonsPanel(bpy.types.Panel):
         return (context.object and context.object.type == 'EMPTY')
 
 
-class DATA_PT_empty(DataButtonsPanel):
+class DATA_PT_empty(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Empty"
 
     def draw(self, context):
@@ -48,20 +48,13 @@ class DATA_PT_empty(DataButtonsPanel):
         layout.prop(ob, "empty_draw_size", text="Size")
 
 
-classes = [
-    DATA_PT_empty]
-
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 14493301b1e99e2a56e3f810c7ec6e9034d1663c..e72739f5ec7cc5364c383a08f8e28907a20d3cd5 100644 (file)
@@ -31,7 +31,7 @@ class LAMP_MT_sunsky_presets(bpy.types.Menu):
     draw = bpy.types.Menu.draw_preset
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -40,16 +40,14 @@ class DataButtonsPanel(bpy.types.Panel):
         engine = context.scene.render.engine
         return context.lamp and (engine in self.COMPAT_ENGINES)
 
-
-class DATA_PT_preview(DataButtonsPanel):
+class DATA_PT_preview(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Preview"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
         self.layout.template_preview(context.lamp)
 
-
-class DATA_PT_context_lamp(DataButtonsPanel):
+class DATA_PT_context_lamp(DataButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -77,12 +75,12 @@ class DATA_PT_context_lamp(DataButtonsPanel):
                 layout.template_ID(space, "pin_id")
 
 
-class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel):
+class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "object.data"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
 
-class DATA_PT_lamp(DataButtonsPanel):
+class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Lamp"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -129,7 +127,7 @@ class DATA_PT_lamp(DataButtonsPanel):
         col.prop(lamp, "diffuse")
 
 
-class DATA_PT_sunsky(DataButtonsPanel):
+class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Sky & Atmosphere"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -202,7 +200,7 @@ class DATA_PT_sunsky(DataButtonsPanel):
         sub.prop(lamp, "atmosphere_extinction", slider=True, text="Extinction")
 
 
-class DATA_PT_shadow(DataButtonsPanel):
+class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Shadow"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -327,7 +325,7 @@ class DATA_PT_shadow(DataButtonsPanel):
             sub.prop(lamp, "shadow_buffer_clip_end", text=" Clip End")
 
 
-class DATA_PT_area(DataButtonsPanel):
+class DATA_PT_area(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Area Shape"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -354,7 +352,7 @@ class DATA_PT_area(DataButtonsPanel):
             sub.prop(lamp, "size_y", text="Size Y")
 
 
-class DATA_PT_spot(DataButtonsPanel):
+class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Spot Shape"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -390,7 +388,7 @@ class DATA_PT_spot(DataButtonsPanel):
             sub.prop(lamp, "halo_step", text="Step")
 
 
-class DATA_PT_falloff_curve(DataButtonsPanel):
+class DATA_PT_falloff_curve(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Falloff Curve"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -407,31 +405,12 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
         self.layout.template_curve_mapping(lamp, "falloff_curve")
 
 
-classes = [
-    LAMP_MT_sunsky_presets,
-
-    DATA_PT_context_lamp,
-    DATA_PT_preview,
-    DATA_PT_lamp,
-    DATA_PT_falloff_curve,
-    DATA_PT_area,
-    DATA_PT_spot,
-    DATA_PT_shadow,
-    DATA_PT_sunsky,
-
-    DATA_PT_custom_props_lamp]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 2aa719437a7dafe18cf01402509a655411f3d69f..4bc6d9865e0c1617b9528f0db11ee759ed43b1ee 100644 (file)
@@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -32,7 +32,7 @@ class DataButtonsPanel(bpy.types.Panel):
         return context.lattice
 
 
-class DATA_PT_context_lattice(DataButtonsPanel):
+class DATA_PT_context_lattice(DataButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
 
@@ -59,11 +59,11 @@ class DATA_PT_context_lattice(DataButtonsPanel):
                 layout.template_ID(space, "pin_id")
 
 
-class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel):
+class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "object.data"
 
 
-class DATA_PT_lattice(DataButtonsPanel):
+class DATA_PT_lattice(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Lattice"
 
     def draw(self, context):
@@ -98,23 +98,12 @@ class DATA_PT_lattice(DataButtonsPanel):
         row.prop_object(lat, "vertex_group", context.object, "vertex_groups", text="")
 
 
-classes = [
-    DATA_PT_context_lattice,
-    DATA_PT_lattice,
-
-    DATA_PT_custom_props_lattice]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index c3170be886010d367c3c152840d3a5b088a1f2f4..b3d5215db5809c83ac0c39e8050006792c5051d9 100644 (file)
@@ -49,7 +49,7 @@ class MESH_MT_shape_key_specials(bpy.types.Menu):
         layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT')
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -59,7 +59,7 @@ class DataButtonsPanel(bpy.types.Panel):
         return context.mesh and (engine in self.COMPAT_ENGINES)
 
 
-class DATA_PT_context_mesh(DataButtonsPanel):
+class DATA_PT_context_mesh(DataButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -87,12 +87,12 @@ class DATA_PT_context_mesh(DataButtonsPanel):
                 layout.template_ID(space, "pin_id")
 
 
-class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel):
+class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "object.data"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
 
-class DATA_PT_normals(DataButtonsPanel):
+class DATA_PT_normals(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Normals"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -117,7 +117,7 @@ class DATA_PT_normals(DataButtonsPanel):
         col.prop(mesh, "double_sided")
 
 
-class DATA_PT_settings(DataButtonsPanel):
+class DATA_PT_settings(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Settings"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -129,7 +129,7 @@ class DATA_PT_settings(DataButtonsPanel):
         layout.prop(mesh, "texture_mesh")
 
 
-class DATA_PT_vertex_groups(DataButtonsPanel):
+class DATA_PT_vertex_groups(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Vertex Groups"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -176,7 +176,7 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
             layout.prop(context.tool_settings, "vertex_group_weight", text="Weight")
 
 
-class DATA_PT_shape_keys(DataButtonsPanel):
+class DATA_PT_shape_keys(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Shape Keys"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -274,7 +274,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
                 row.prop(key, "slurph")
 
 
-class DATA_PT_uv_texture(DataButtonsPanel):
+class DATA_PT_uv_texture(DataButtonsPanel, bpy.types.Panel):
     bl_label = "UV Texture"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -344,7 +344,7 @@ class DATA_PT_texface(DataButtonsPanel):
             col.label(text="No UV Texture")
 
 
-class DATA_PT_vertex_colors(DataButtonsPanel):
+class DATA_PT_vertex_colors(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Vertex Colors"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -367,32 +367,12 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
             layout.prop(lay, "name")
 
 
-classes = [
-    MESH_MT_vertex_group_specials,
-    MESH_MT_shape_key_specials,
-
-    DATA_PT_context_mesh,
-    DATA_PT_normals,
-    DATA_PT_settings,
-    DATA_PT_vertex_groups,
-    DATA_PT_shape_keys,
-    DATA_PT_uv_texture,
-    DATA_PT_texface,
-    DATA_PT_vertex_colors,
-
-    DATA_PT_custom_props_mesh]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index e0155059b98a14ac00f075ac917fa2301cea4de5..1cce0cea66fc0a057b8efaa59522f90909aa0381 100644 (file)
@@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -32,7 +32,7 @@ class DataButtonsPanel(bpy.types.Panel):
         return context.meta_ball
 
 
-class DATA_PT_context_metaball(DataButtonsPanel):
+class DATA_PT_context_metaball(DataButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
 
@@ -59,11 +59,11 @@ class DATA_PT_context_metaball(DataButtonsPanel):
                 layout.template_ID(space, "pin_id")
 
 
-class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel):
+class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "object.data"
 
 
-class DATA_PT_metaball(DataButtonsPanel):
+class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Metaball"
 
     def draw(self, context):
@@ -92,7 +92,7 @@ class DATA_PT_metaball(DataButtonsPanel):
             layout.prop(mball, "flag", text="")
 
 
-class DATA_PT_metaball_element(DataButtonsPanel):
+class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Active Element"
 
     def poll(self, context):
@@ -136,24 +136,12 @@ class DATA_PT_metaball_element(DataButtonsPanel):
             col.prop(metaelem, "size_y", text="Y")
 
 
-classes = [
-    DATA_PT_context_metaball,
-    DATA_PT_metaball,
-    DATA_PT_metaball_element,
-
-    DATA_PT_custom_props_metaball]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 37764e208547b8fab0f132e4391edf4aebc95e8b..ea0fb606aa49121a955ae80fc4ceb717e2f16591 100644 (file)
@@ -23,13 +23,13 @@ narrowui = bpy.context.user_preferences.view.properties_width_check
 narrowmod = 260
 
 
-class DataButtonsPanel(bpy.types.Panel):
+class DataButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "modifier"
 
 
-class DATA_PT_modifiers(DataButtonsPanel):
+class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
     bl_label = "Modifiers"
 
     def draw(self, context):
@@ -766,20 +766,12 @@ class DATA_PT_modifiers(DataButtonsPanel):
         col.prop(md, "narrowness", slider=True)
 
 
-classes = [
-    DATA_PT_modifiers]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 88803993c9257b5576569b8a9376150bb9e09d3e..b12f368f5f47de51018fd777a047701324335ba3 100644 (file)
@@ -22,7 +22,7 @@ import bpy
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class PhysicsButtonsPanel(bpy.types.Panel):
+class PhysicsButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "physics"
@@ -33,7 +33,7 @@ class PhysicsButtonsPanel(bpy.types.Panel):
         return ob and ob.game and (rd.engine in self.COMPAT_ENGINES)
 
 
-class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
+class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
     bl_label = "Physics"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -162,7 +162,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
             layout.prop(ob, "hide_render", text="Invisible")
 
 
-class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
+class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, bpy.types.Panel):
     bl_label = "Collision Bounds"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -198,7 +198,7 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
         col.prop(game, "collision_compound", text="Compound")
 
 
-class RenderButtonsPanel(bpy.types.Panel):
+class RenderButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "render"
@@ -208,7 +208,7 @@ class RenderButtonsPanel(bpy.types.Panel):
         return (rd.engine in self.COMPAT_ENGINES)
 
 
-class RENDER_PT_game(RenderButtonsPanel):
+class RENDER_PT_game(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Game"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -220,7 +220,7 @@ class RENDER_PT_game(RenderButtonsPanel):
         row.label()
 
 
-class RENDER_PT_game_player(RenderButtonsPanel):
+class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Standalone Player"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -258,7 +258,7 @@ class RENDER_PT_game_player(RenderButtonsPanel):
             col.prop(gs, "framing_color", text="")
 
 
-class RENDER_PT_game_stereo(RenderButtonsPanel):
+class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Stereo"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -318,7 +318,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
             layout.prop(gs, "dome_text")
 
 
-class RENDER_PT_game_shading(RenderButtonsPanel):
+class RENDER_PT_game_shading(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Shading"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -347,7 +347,7 @@ class RENDER_PT_game_shading(RenderButtonsPanel):
             col.prop(gs, "glsl_extra_textures", text="Extra Textures")
 
 
-class RENDER_PT_game_performance(RenderButtonsPanel):
+class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Performance"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -373,7 +373,7 @@ class RENDER_PT_game_performance(RenderButtonsPanel):
         col.prop(gs, "use_display_lists")
 
 
-class RENDER_PT_game_sound(RenderButtonsPanel):
+class RENDER_PT_game_sound(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Sound"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -391,7 +391,7 @@ class RENDER_PT_game_sound(RenderButtonsPanel):
         layout.prop(scene, "doppler_factor")
 
 
-class WorldButtonsPanel(bpy.types.Panel):
+class WorldButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "world"
@@ -401,7 +401,7 @@ class WorldButtonsPanel(bpy.types.Panel):
         return (scene.render.engine in self.COMPAT_ENGINES) and (scene.world is not None)
 
 
-class WORLD_PT_game_context_world(WorldButtonsPanel):
+class WORLD_PT_game_context_world(WorldButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
     COMPAT_ENGINES = {'BLENDER_GAME'}
@@ -431,7 +431,7 @@ class WORLD_PT_game_context_world(WorldButtonsPanel):
                 layout.template_ID(space, "pin_id")
 
 
-class WORLD_PT_game_world(WorldButtonsPanel):
+class WORLD_PT_game_world(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "World"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -451,7 +451,7 @@ class WORLD_PT_game_world(WorldButtonsPanel):
         col.prop(world, "ambient_color")
 
 
-class WORLD_PT_game_mist(WorldButtonsPanel):
+class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Mist"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -477,7 +477,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel):
         col.prop(world.mist, "depth")
 
 
-class WORLD_PT_game_physics(WorldButtonsPanel):
+class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Physics"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -523,33 +523,12 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
             col.prop(gs, "logic_step_max", text="Max")
 
 
-classes = [
-    PHYSICS_PT_game_physics,
-    PHYSICS_PT_game_collision_bounds,
-
-    RENDER_PT_game,
-    RENDER_PT_game_player,
-    RENDER_PT_game_stereo,
-    RENDER_PT_game_shading,
-    RENDER_PT_game_performance,
-    RENDER_PT_game_sound,
-
-    WORLD_PT_game_context_world,
-    WORLD_PT_game_world,
-    WORLD_PT_game_mist,
-    WORLD_PT_game_physics]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 8d3794919835be656250c92e5fe3f3ef4e29c659..31dc23563bda235ded642c8ec6f3d8409384e20c 100644 (file)
@@ -54,7 +54,7 @@ class MATERIAL_MT_specials(bpy.types.Menu):
         layout.operator("material.paste", icon='PASTEDOWN')
 
 
-class MaterialButtonsPanel(bpy.types.Panel):
+class MaterialButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "material"
@@ -66,7 +66,7 @@ class MaterialButtonsPanel(bpy.types.Panel):
         return mat and (engine in self.COMPAT_ENGINES)
 
 
-class MATERIAL_PT_preview(MaterialButtonsPanel):
+class MATERIAL_PT_preview(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Preview"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -74,7 +74,7 @@ class MATERIAL_PT_preview(MaterialButtonsPanel):
         self.layout.template_preview(context.material)
 
 
-class MATERIAL_PT_context_material(MaterialButtonsPanel):
+class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -141,12 +141,12 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
                 layout.prop(mat, "type", text="")
 
 
-class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel):
+class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER'}
     _context_path = "material"
 
 
-class MATERIAL_PT_shading(MaterialButtonsPanel):
+class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Shading"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -184,7 +184,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
             layout.prop(mat, "alpha")
 
 
-class MATERIAL_PT_strand(MaterialButtonsPanel):
+class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Strand"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -233,7 +233,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
         sub.prop(tan, "blend_distance", text="Distance")
 
 
-class MATERIAL_PT_physics(MaterialButtonsPanel):
+class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Physics"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
@@ -257,7 +257,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
         col.prop(phys, "damp", slider=True)
 
 
-class MATERIAL_PT_options(MaterialButtonsPanel):
+class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Options"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -302,7 +302,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
         col.prop(mat, "object_color")
 
 
-class MATERIAL_PT_shadow(MaterialButtonsPanel):
+class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Shadow"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -339,8 +339,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
         sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
         col.prop(mat, "cast_approximate")
 
-
-class MATERIAL_PT_diffuse(MaterialButtonsPanel):
+class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Diffuse"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -411,7 +410,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
             row.prop(mat, "diffuse_ramp_factor", text="Factor")
 
 
-class MATERIAL_PT_specular(MaterialButtonsPanel):
+class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Specular"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -480,7 +479,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
             row.prop(mat, "specular_ramp_factor", text="Factor")
 
 
-class MATERIAL_PT_sss(MaterialButtonsPanel):
+class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Subsurface Scattering"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -532,7 +531,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
         col.prop(sss, "error_tolerance", text="Error")
 
 
-class MATERIAL_PT_mirror(MaterialButtonsPanel):
+class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Mirror"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -592,7 +591,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
         sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
 
 
-class MATERIAL_PT_transp(MaterialButtonsPanel):
+class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Transparency"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -659,7 +658,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
             sub.prop(rayt, "gloss_samples", text="Samples")
 
 
-class MATERIAL_PT_transp_game(MaterialButtonsPanel):
+class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Transparency"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_GAME'}
@@ -694,7 +693,7 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel):
         col.prop(mat, "alpha")
 
 
-class MATERIAL_PT_halo(MaterialButtonsPanel):
+class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Halo"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -744,7 +743,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
         sub.prop(halo, "star_tips")
 
 
-class MATERIAL_PT_flare(MaterialButtonsPanel):
+class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Flare"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -779,7 +778,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel):
         col.prop(halo, "flare_subsize", text="Subsize")
 
 
-class VolumeButtonsPanel(bpy.types.Panel):
+class VolumeButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "material"
@@ -790,7 +789,7 @@ class VolumeButtonsPanel(bpy.types.Panel):
         return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
 
 
-class MATERIAL_PT_volume_density(VolumeButtonsPanel):
+class MATERIAL_PT_volume_density(VolumeButtonsPanel, bpy.types.Panel):
     bl_label = "Density"
     bl_default_closed = False
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -810,7 +809,7 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel):
         col.prop(vol, "density_scale")
 
 
-class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
+class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel):
     bl_label = "Shading"
     bl_default_closed = False
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -838,7 +837,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
         sub.prop(vol, "reflection_color", text="")
 
 
-class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
+class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel):
     bl_label = "Lighting"
     bl_default_closed = False
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -876,7 +875,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
             sub.prop(vol, "ms_intensity")
 
 
-class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
+class MATERIAL_PT_volume_transp(VolumeButtonsPanel, bpy.types.Panel):
     bl_label = "Transparency"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -892,7 +891,7 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
             layout.prop(mat, "transparency_method", text="")
 
 
-class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
+class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
     bl_label = "Integration"
     bl_default_closed = False
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -917,7 +916,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
         col.prop(vol, "depth_cutoff")
 
 
-class MATERIAL_PT_volume_options(VolumeButtonsPanel):
+class MATERIAL_PT_volume_options(VolumeButtonsPanel, bpy.types.Panel):
     bl_label = "Options"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
     bl_default_closed = True
@@ -943,46 +942,12 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel):
         row.prop(mat, "light_group_exclusive", text="Exclusive")
 
 
-classes = [
-    MATERIAL_PT_context_material,
-    MATERIAL_PT_preview,
-    MATERIAL_PT_diffuse,
-    MATERIAL_PT_specular,
-    MATERIAL_PT_shading,
-    MATERIAL_PT_transp,
-    MATERIAL_PT_mirror,
-    MATERIAL_PT_sss,
-    MATERIAL_PT_halo,
-    MATERIAL_PT_flare,
-    MATERIAL_PT_physics,
-    MATERIAL_PT_strand,
-    MATERIAL_PT_options,
-    MATERIAL_PT_shadow,
-    MATERIAL_PT_transp_game,
-
-    MATERIAL_MT_sss_presets,
-    MATERIAL_MT_specials,
-
-    MATERIAL_PT_volume_density,
-    MATERIAL_PT_volume_shading,
-    MATERIAL_PT_volume_lighting,
-    MATERIAL_PT_volume_transp,
-    MATERIAL_PT_volume_integration,
-    MATERIAL_PT_volume_options,
-
-    MATERIAL_PT_custom_props]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 4e60879d6654e1333a4e87f436bcd9816f6114cd..f09de20c8f3bfbe42d7eb226991f86b173353982 100644 (file)
@@ -23,13 +23,13 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class ObjectButtonsPanel(bpy.types.Panel):
+class ObjectButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "object"
 
 
-class OBJECT_PT_context_object(ObjectButtonsPanel):
+class OBJECT_PT_context_object(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
 
@@ -46,11 +46,7 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
             row.prop(ob, "name", text="")
 
 
-class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel):
-    _context_path = "object"
-
-
-class OBJECT_PT_transform(ObjectButtonsPanel):
+class OBJECT_PT_transform(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Transform"
 
     def draw(self, context):
@@ -90,7 +86,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
             col.prop(ob, "scale")
 
 
-class OBJECT_PT_transform_locks(ObjectButtonsPanel):
+class OBJECT_PT_transform_locks(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Transform Locks"
     bl_default_closed = True
 
@@ -117,7 +113,7 @@ class OBJECT_PT_transform_locks(ObjectButtonsPanel):
         row.column().prop(ob, "lock_scale", text="Scale")
 
 
-class OBJECT_PT_relations(ObjectButtonsPanel):
+class OBJECT_PT_relations(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Relations"
 
     def draw(self, context):
@@ -146,7 +142,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
         sub.active = (parent is not None)
 
 
-class OBJECT_PT_groups(ObjectButtonsPanel):
+class OBJECT_PT_groups(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Groups"
 
     def draw(self, context):
@@ -187,7 +183,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
                 index += 1
 
 
-class OBJECT_PT_display(ObjectButtonsPanel):
+class OBJECT_PT_display(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Display"
 
     def draw(self, context):
@@ -223,7 +219,7 @@ class OBJECT_PT_display(ObjectButtonsPanel):
         col.prop(ob, "draw_transparent", text="Transparency")
 
 
-class OBJECT_PT_duplication(ObjectButtonsPanel):
+class OBJECT_PT_duplication(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Duplication"
 
     def draw(self, context):
@@ -272,8 +268,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
 
 # XXX: the following options are all quite buggy, ancient hacks that should be dropped
 
-
-class OBJECT_PT_animation(ObjectButtonsPanel):
+class OBJECT_PT_animation(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Animation Hacks"
     bl_default_closed = True
 
@@ -306,36 +301,60 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
         col.prop(ob, "track_axis", text="Axis")
         col.prop(ob, "up_axis", text="Up Axis")
 
+from properties_animviz import MotionPathButtonsPanel, OnionSkinButtonsPanel
+
+
+class OBJECT_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
+    #bl_label = "Object Motion Paths"
+    bl_context = "object"
+
+    def poll(self, context):
+        return (context.object)
 
-# import generic panels from other files
-from properties_animviz import OBJECT_PT_motion_paths, OBJECT_PT_onion_skinning
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        wide_ui = context.region.width > narrowui
+
+        self.draw_settings(context, ob.animation_visualisation, wide_ui)
 
-classes = [
-    OBJECT_PT_context_object,
-    OBJECT_PT_transform,
-    OBJECT_PT_transform_locks,
-    OBJECT_PT_relations,
-    OBJECT_PT_groups,
-    OBJECT_PT_display,
-    OBJECT_PT_duplication,
-    OBJECT_PT_animation, # XXX: panel of old hacks pending to be removed...
+        layout.separator()
 
-    OBJECT_PT_motion_paths,
-    #OBJECT_PT_onion_skinning,
+        split = layout.split()
 
-    OBJECT_PT_custom_props]
+        col = split.column()
+        col.operator("object.paths_calculate", text="Calculate Paths")
 
+        if wide_ui:
+            col = split.column()
+        col.operator("object.paths_clear", text="Clear Paths")
+
+
+class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # inherit from panel when ready
+    #bl_label = "Object Onion Skinning"
+    bl_context = "object"
+
+    def poll(self, context):
+        return (context.object)
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        wide_ui = context.region.width > narrowui
+
+        self.draw_settings(context, ob.animation_visualisation, wide_ui)
+
+class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel):
+    _context_path = "object"
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index edeadb9326b9f374c855f068a975c48144138b67..bc8fd6ad9dadddbd65f40316e3aca2d655f29e1c 100644 (file)
@@ -23,7 +23,7 @@ narrowui = bpy.context.user_preferences.view.properties_width_check
 narrowcon = 260
 
 
-class ConstraintButtonsPanel(bpy.types.Panel):
+class ConstraintButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "constraint"
@@ -749,8 +749,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
         col = layout.column()
         col.prop(con, "enabled_rotation_range", text="Pivot When")
 
-
-class OBJECT_PT_constraints(ConstraintButtonsPanel):
+class OBJECT_PT_constraints(ConstraintButtonsPanel, bpy.types.Panel):
     bl_label = "Object Constraints"
     bl_context = "constraint"
 
@@ -768,7 +767,7 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel):
             self.draw_constraint(context, con)
 
 
-class BONE_PT_constraints(ConstraintButtonsPanel):
+class BONE_PT_constraints(ConstraintButtonsPanel, bpy.types.Panel):
     bl_label = "Bone Constraints"
     bl_context = "bone_constraint"
 
@@ -784,21 +783,12 @@ class BONE_PT_constraints(ConstraintButtonsPanel):
             self.draw_constraint(context, con)
 
 
-classes = [
-    OBJECT_PT_constraints,
-    BONE_PT_constraints]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index f858c9b8511a919f46081c4080be9344209e2bc3..ed516b49dea5f51c3c5aa0de618d84802bf77c20 100644 (file)
@@ -42,7 +42,7 @@ def particle_panel_poll(panel, context):
     return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR') and (engine in panel.COMPAT_ENGINES)
 
 
-class ParticleButtonsPanel(bpy.types.Panel):
+class ParticleButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "particle"
@@ -51,7 +51,7 @@ class ParticleButtonsPanel(bpy.types.Panel):
         return particle_panel_poll(self, context)
 
 
-class PARTICLE_PT_context_particles(ParticleButtonsPanel):
+class PARTICLE_PT_context_particles(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -136,12 +136,12 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel):
                     split.prop(psys, "reactor_target_particle_system", text="Particle System")
 
 
-class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel):
+class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, bpy.types.Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER'}
     _context_path = "particle_system.settings"
 
 
-class PARTICLE_PT_emission(ParticleButtonsPanel):
+class PARTICLE_PT_emission(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Emission"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -203,7 +203,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel):
                 row.prop(part, "grid_resolution")
 
 
-class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
+class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Hair dynamics"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -260,7 +260,7 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
         col.prop(cloth, "quality", text="Steps", slider=True)
 
 
-class PARTICLE_PT_cache(ParticleButtonsPanel):
+class PARTICLE_PT_cache(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Cache"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -283,7 +283,7 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
         point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if psys.hair_dynamics else 'PSYS')
 
 
-class PARTICLE_PT_velocity(ParticleButtonsPanel):
+class PARTICLE_PT_velocity(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Velocity"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -330,7 +330,7 @@ class PARTICLE_PT_velocity(ParticleButtonsPanel):
         #    sub.prop(part, "reaction_shape", slider=True)
 
 
-class PARTICLE_PT_rotation(ParticleButtonsPanel):
+class PARTICLE_PT_rotation(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Rotation"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -376,7 +376,7 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel):
             sub.prop(part, "angular_velocity_factor", text="")
 
 
-class PARTICLE_PT_physics(ParticleButtonsPanel):
+class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Physics"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -573,7 +573,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
                     sub.prop(key, "system", text="System")
 
 
-class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
+class PARTICLE_PT_boidbrain(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Boid Brain"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -673,7 +673,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
                 row.prop(rule, "flee_distance")
 
 
-class PARTICLE_PT_render(ParticleButtonsPanel):
+class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Render"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -843,7 +843,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
                 col.label(text="")
 
 
-class PARTICLE_PT_draw(ParticleButtonsPanel):
+class PARTICLE_PT_draw(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Display"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -902,7 +902,7 @@ class PARTICLE_PT_draw(ParticleButtonsPanel):
             #sub.label(text="Override material color")
 
 
-class PARTICLE_PT_children(ParticleButtonsPanel):
+class PARTICLE_PT_children(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Children"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -987,7 +987,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel):
         col.prop(part, "kink_shape", slider=True)
 
 
-class PARTICLE_PT_field_weights(ParticleButtonsPanel):
+class PARTICLE_PT_field_weights(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Field Weights"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -1000,7 +1000,7 @@ class PARTICLE_PT_field_weights(ParticleButtonsPanel):
             self.layout.prop(part.effector_weights, "do_growing_hair")
 
 
-class PARTICLE_PT_force_fields(ParticleButtonsPanel):
+class PARTICLE_PT_force_fields(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Force Field Settings"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -1028,7 +1028,7 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel):
         basic_force_field_falloff_ui(self, context, part.force_field_2)
 
 
-class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
+class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, bpy.types.Panel):
     bl_label = "Vertexgroups"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -1096,35 +1096,12 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
         row.prop(psys, "vertex_group_field_negate", text="")
 
 
-classes = [
-    PARTICLE_PT_context_particles,
-    PARTICLE_PT_hair_dynamics,
-    PARTICLE_PT_cache,
-    PARTICLE_PT_emission,
-    PARTICLE_PT_velocity,
-    PARTICLE_PT_rotation,
-    PARTICLE_PT_physics,
-    PARTICLE_PT_boidbrain,
-    PARTICLE_PT_render,
-    PARTICLE_PT_draw,
-    PARTICLE_PT_children,
-    PARTICLE_PT_field_weights,
-    PARTICLE_PT_force_fields,
-    PARTICLE_PT_vertexgroups,
-
-    PARTICLE_PT_custom_props]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 61e1fe81812a3a1556a0356507ee38e3b97e4eef..af393c0d239231087bba3f7ba9b5edbd1e3f9655 100644 (file)
@@ -40,7 +40,7 @@ class CLOTH_MT_presets(bpy.types.Menu):
     draw = bpy.types.Menu.draw_preset
 
 
-class PhysicButtonsPanel(bpy.types.Panel):
+class PhysicButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "physics"
@@ -51,7 +51,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
         return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
 
 
-class PHYSICS_PT_cloth(PhysicButtonsPanel):
+class PHYSICS_PT_cloth(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Cloth"
 
     def draw(self, context):
@@ -133,7 +133,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
                 col.prop_object(cloth, "rest_shape_key", key, "keys", text="")
 
 
-class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
+class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Cloth Cache"
     bl_default_closed = True
 
@@ -145,7 +145,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
         point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
 
 
-class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
+class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Cloth Collision"
     bl_default_closed = True
 
@@ -185,7 +185,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
         layout.prop(cloth, "group")
 
 
-class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
+class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Cloth Stiffness Scaling"
     bl_default_closed = True
 
@@ -222,7 +222,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
         col.prop(cloth, "bending_stiffness_max", text="Max")
 
 
-class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
+class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Cloth Field Weights"
     bl_default_closed = True
 
@@ -234,26 +234,12 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
         effector_weights_ui(self, context, cloth.effector_weights)
 
 
-classes = [
-    CLOTH_MT_presets,
-
-    PHYSICS_PT_cloth,
-    PHYSICS_PT_cloth_cache,
-    PHYSICS_PT_cloth_collision,
-    PHYSICS_PT_cloth_stiffness,
-    PHYSICS_PT_cloth_field_weights]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 57fa40e4c5dd25311b5c6c53de1ef4c1e3a4f636..963fbe082265bbaa8c254e6625b696b7329d78b0 100644 (file)
@@ -26,7 +26,7 @@ from properties_physics_common import basic_force_field_settings_ui
 from properties_physics_common import basic_force_field_falloff_ui
 
 
-class PhysicButtonsPanel(bpy.types.Panel):
+class PhysicButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "physics"
@@ -36,7 +36,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
         return (context.object) and (not rd.use_game_engine)
 
 
-class PHYSICS_PT_field(PhysicButtonsPanel):
+class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Force Fields"
 
     def draw(self, context):
@@ -169,7 +169,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
                 sub.prop(field, "radial_maximum", text="Distance")
 
 
-class PHYSICS_PT_collision(PhysicButtonsPanel):
+class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Collision"
     #bl_default_closed = True
 
@@ -243,21 +243,12 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
             col.prop(settings, "absorption", text="Absorption")
 
 
-classes = [
-    PHYSICS_PT_field,
-    PHYSICS_PT_collision]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 32acd88654d09cba5e09525edae8bff7daf0d355..c24052c59fe13e62f0ecf945254e0b99dcccc316 100644 (file)
@@ -22,7 +22,7 @@ import bpy
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class PhysicButtonsPanel(bpy.types.Panel):
+class PhysicButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "physics"
@@ -33,7 +33,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
         return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
 
 
-class PHYSICS_PT_fluid(PhysicButtonsPanel):
+class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Fluid"
 
     def draw(self, context):
@@ -216,7 +216,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
                 sub.prop(fluid, "velocity_radius", text="Radius")
 
 
-class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
+class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Domain World"
     bl_default_closed = True
 
@@ -267,7 +267,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
         col.prop(fluid, "compressibility", slider=True)
 
 
-class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
+class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Domain Boundary"
     bl_default_closed = True
 
@@ -296,7 +296,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
         col.prop(fluid, "surface_subdivisions", text="Subdivisions")
 
 
-class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
+class PHYSICS_PT_domain_particles(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Domain Particles"
     bl_default_closed = True
 
@@ -314,23 +314,12 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
         col.prop(fluid, "generate_particles")
 
 
-classes = [
-    PHYSICS_PT_fluid,
-    PHYSICS_PT_domain_gravity,
-    PHYSICS_PT_domain_boundary,
-    PHYSICS_PT_domain_particles]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 9bae4c5b63fb7a8f2be2becb1dd4dac4a2c88a51..5709a239858678537a9895c5bddbdf8ef1185967 100644 (file)
@@ -26,7 +26,7 @@ from properties_physics_common import point_cache_ui
 from properties_physics_common import effector_weights_ui
 
 
-class PhysicButtonsPanel(bpy.types.Panel):
+class PhysicButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "physics"
@@ -37,7 +37,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
         return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
 
 
-class PHYSICS_PT_smoke(PhysicButtonsPanel):
+class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Smoke"
 
     def draw(self, context):
@@ -126,7 +126,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
             #  layout.separator()
 
 
-class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
+class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Smoke Groups"
     bl_default_closed = True
 
@@ -155,7 +155,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
         col.prop(group, "coll_group", text="")
 
 
-class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
+class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Smoke Cache"
     bl_default_closed = True
 
@@ -175,7 +175,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
         point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
 
 
-class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
+class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Smoke High Resolution"
     bl_default_closed = True
 
@@ -211,7 +211,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
         col.prop(md, "strength")
 
 
-class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
+class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Smoke High Resolution Cache"
     bl_default_closed = True
 
@@ -231,7 +231,7 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
         point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
 
 
-class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
+class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Smoke Field Weights"
     bl_default_closed = True
 
@@ -244,25 +244,12 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
         effector_weights_ui(self, context, domain.effector_weights)
 
 
-classes = [
-    PHYSICS_PT_smoke,
-    PHYSICS_PT_smoke_field_weights,
-    PHYSICS_PT_smoke_cache,
-    PHYSICS_PT_smoke_highres,
-    PHYSICS_PT_smoke_groups,
-    PHYSICS_PT_smoke_cache_highres]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 60149cf533b4ca3caed4cbd1f980fa1b9803c0ae..5e7aae2663011e6a99fe6a27363cf4a571305b8a 100644 (file)
@@ -30,7 +30,7 @@ def softbody_panel_enabled(md):
     return (md.point_cache.baked is False)
 
 
-class PhysicButtonsPanel(bpy.types.Panel):
+class PhysicButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "physics"
@@ -43,7 +43,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
         return (ob and (ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE')) and (not rd.use_game_engine)
 
 
-class PHYSICS_PT_softbody(PhysicButtonsPanel):
+class PHYSICS_PT_softbody(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Soft Body"
 
     def draw(self, context):
@@ -88,7 +88,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
             col.prop(softbody, "speed")
 
 
-class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
+class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Soft Body Cache"
     bl_default_closed = True
 
@@ -100,7 +100,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
         point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY')
 
 
-class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
+class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Soft Body Goal"
     bl_default_closed = True
 
@@ -144,7 +144,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
         layout.prop_object(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
 
 
-class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
+class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Soft Body Edges"
     bl_default_closed = True
 
@@ -199,7 +199,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
         col.prop(softbody, "face_collision", text="Face")
 
 
-class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
+class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Soft Body Self Collision"
     bl_default_closed = True
 
@@ -234,7 +234,7 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
         col.prop(softbody, "ball_damp", text="Dampening")
 
 
-class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
+class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Soft Body Solver"
     bl_default_closed = True
 
@@ -271,7 +271,7 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
         layout.prop(softbody, "estimate_matrix")
 
 
-class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
+class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, bpy.types.Panel):
     bl_label = "Soft Body Field Weights"
     bl_default_closed = True
 
@@ -285,26 +285,12 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
         effector_weights_ui(self, context, softbody.effector_weights)
 
 
-classes = [
-    PHYSICS_PT_softbody,
-    PHYSICS_PT_softbody_cache,
-    PHYSICS_PT_softbody_goal,
-    PHYSICS_PT_softbody_edge,
-    PHYSICS_PT_softbody_collision,
-    PHYSICS_PT_softbody_solver,
-    PHYSICS_PT_softbody_field_weights]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 9a15387575604ff34dfa3525c788a21f02ef6575..4e6596957d7cb4a85e818e229744cb4f7790f32c 100644 (file)
@@ -36,7 +36,7 @@ class RENDER_MT_ffmpeg_presets(bpy.types.Menu):
     draw = bpy.types.Menu.draw_preset
 
 
-class RenderButtonsPanel(bpy.types.Panel):
+class RenderButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "render"
@@ -47,7 +47,7 @@ class RenderButtonsPanel(bpy.types.Panel):
         return (context.scene and rd.use_game_engine is False) and (rd.engine in self.COMPAT_ENGINES)
 
 
-class RENDER_PT_render(RenderButtonsPanel):
+class RENDER_PT_render(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Render"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -69,7 +69,7 @@ class RENDER_PT_render(RenderButtonsPanel):
         layout.prop(rd, "display_mode", text="Display")
 
 
-class RENDER_PT_layers(RenderButtonsPanel):
+class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Layers"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -174,7 +174,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
         row.prop(rl, "pass_refraction_exclude", text="")
 
 
-class RENDER_PT_shading(RenderButtonsPanel):
+class RENDER_PT_shading(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Shading"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -199,7 +199,7 @@ class RENDER_PT_shading(RenderButtonsPanel):
         col.prop(rd, "alpha_mode", text="Alpha")
 
 
-class RENDER_PT_performance(RenderButtonsPanel):
+class RENDER_PT_performance(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Performance"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -243,7 +243,7 @@ class RENDER_PT_performance(RenderButtonsPanel):
         sub.prop(rd, "use_local_coords", text="Local Coordinates")
 
 
-class RENDER_PT_post_processing(RenderButtonsPanel):
+class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Post Processing"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -287,7 +287,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
         sub.prop(rd, "edge_color", text="")
 
 
-class RENDER_PT_output(RenderButtonsPanel):
+class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Output"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -407,7 +407,7 @@ class RENDER_PT_output(RenderButtonsPanel):
                 col.prop(rd, "quicktime_audio_resampling_hq")
 
 
-class RENDER_PT_encoding(RenderButtonsPanel):
+class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Encoding"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -479,7 +479,7 @@ class RENDER_PT_encoding(RenderButtonsPanel):
         col.prop(rd, "ffmpeg_audio_volume", slider=True)
 
 
-class RENDER_PT_antialiasing(RenderButtonsPanel):
+class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Anti-Aliasing"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -509,7 +509,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
         col.prop(rd, "filter_size", text="Size")
 
 
-class RENDER_PT_motion_blur(RenderButtonsPanel):
+class RENDER_PT_motion_blur(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Full Sample Motion Blur"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -529,8 +529,7 @@ class RENDER_PT_motion_blur(RenderButtonsPanel):
         row.prop(rd, "motion_blur_samples")
         row.prop(rd, "motion_blur_shutter")
 
-
-class RENDER_PT_dimensions(RenderButtonsPanel):
+class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Dimensions"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -577,7 +576,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
         sub.prop(rd, "fps_base", text="/")
 
 
-class RENDER_PT_stamp(RenderButtonsPanel):
+class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Stamp"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -623,7 +622,7 @@ class RENDER_PT_stamp(RenderButtonsPanel):
         sub.prop(rd, "stamp_note_text", text="")
 
 
-class RENDER_PT_bake(RenderButtonsPanel):
+class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Bake"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -670,33 +669,12 @@ class RENDER_PT_bake(RenderButtonsPanel):
         sub.prop(rd, "bake_bias")
 
 
-classes = [
-    RENDER_MT_presets,
-    RENDER_MT_ffmpeg_presets,
-    RENDER_PT_render,
-    RENDER_PT_layers,
-    RENDER_PT_dimensions,
-    RENDER_PT_antialiasing,
-    RENDER_PT_motion_blur,
-    RENDER_PT_shading,
-    RENDER_PT_output,
-    RENDER_PT_encoding,
-    RENDER_PT_performance,
-    RENDER_PT_post_processing,
-    RENDER_PT_stamp,
-    RENDER_PT_bake]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 06ad1eda8356d5d1399b1fca707285c35b0d196f..859fcc3ce478333e7ccafe1a4f9c7885c76066a7 100644 (file)
@@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class SceneButtonsPanel(bpy.types.Panel):
+class SceneButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "scene"
@@ -32,7 +32,7 @@ class SceneButtonsPanel(bpy.types.Panel):
         return context.scene
 
 
-class SCENE_PT_scene(SceneButtonsPanel):
+class SCENE_PT_scene(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Scene"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -49,11 +49,11 @@ class SCENE_PT_scene(SceneButtonsPanel):
             layout.prop(scene, "set", text="")
 
 
-class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel):
+class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "scene"
 
 
-class SCENE_PT_unit(SceneButtonsPanel):
+class SCENE_PT_unit(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Units"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -78,7 +78,7 @@ class SCENE_PT_unit(SceneButtonsPanel):
         layout.column().prop(unit, "rotation_units")
 
 
-class SCENE_PT_keying_sets(SceneButtonsPanel):
+class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Keying Sets"
 
     def draw(self, context):
@@ -115,7 +115,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
             col.prop(ks, "insertkey_xyz_to_rgb", text="XYZ to RGB")
 
 
-class SCENE_PT_keying_set_paths(SceneButtonsPanel):
+class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Active Keying Set"
 
     def poll(self, context):
@@ -169,7 +169,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel):
             col.prop(ksp, "insertkey_xyz_to_rgb", text="XYZ to RGB")
 
 
-class SCENE_PT_physics(SceneButtonsPanel):
+class SCENE_PT_physics(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Gravity"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -190,7 +190,7 @@ class SCENE_PT_physics(SceneButtonsPanel):
             layout.column().prop(scene, "gravity", text="")
 
 
-class SCENE_PT_simplify(SceneButtonsPanel):
+class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel):
     bl_label = "Simplify"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -334,29 +334,12 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
         return {'RUNNING_MODAL'}
 
 
-classes = [
-    SCENE_PT_scene,
-    SCENE_PT_unit,
-    SCENE_PT_keying_sets,
-    SCENE_PT_keying_set_paths,
-    SCENE_PT_physics,
-    SCENE_PT_simplify,
-
-    SCENE_PT_custom_props,
-
-    ANIM_OT_keying_set_export]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 2bfbe188c9ee8cb8646ed03e2a8b1c193931c07c..d9d8e5cb24dac4ce540aadd715c579d68e12dc3b 100644 (file)
@@ -65,7 +65,7 @@ def context_tex_datablock(context):
     return idblock
 
 
-class TextureButtonsPanel(bpy.types.Panel):
+class TextureButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "texture"
@@ -78,7 +78,7 @@ class TextureButtonsPanel(bpy.types.Panel):
         return (tex.type != 'NONE' or tex.use_nodes) and (engine in self.COMPAT_ENGINES)
 
 
-class TEXTURE_PT_preview(TextureButtonsPanel):
+class TEXTURE_PT_preview(TextureButtonsPanel, bpy.types.Panel):
     bl_label = "Preview"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -95,7 +95,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel):
             layout.template_preview(tex, slot=slot)
 
 
-class TEXTURE_PT_context_texture(TextureButtonsPanel):
+class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -166,7 +166,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
                     layout.prop(tex, "type", text="")
 
 
-class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel):
+class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel):
     _context_path = "texture"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -175,7 +175,7 @@ class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel):
         return context.texture and (engine in self.COMPAT_ENGINES)
 
 
-class TEXTURE_PT_colors(TextureButtonsPanel):
+class TEXTURE_PT_colors(TextureButtonsPanel, bpy.types.Panel):
     bl_label = "Colors"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -220,7 +220,7 @@ class TextureSlotPanel(TextureButtonsPanel):
         return TextureButtonsPanel.poll(self, context) and (engine in self.COMPAT_ENGINES)
 
 
-class TEXTURE_PT_mapping(TextureSlotPanel):
+class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
     bl_label = "Mapping"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -317,7 +317,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
         col.prop(tex, "size")
 
 
-class TEXTURE_PT_influence(TextureSlotPanel):
+class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
     bl_label = "Influence"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -451,7 +451,7 @@ class TextureTypePanel(TextureButtonsPanel):
         return ((tex and tex.type == self.tex_type and not tex.use_nodes) and (engine in self.COMPAT_ENGINES))
 
 
-class TEXTURE_PT_clouds(TextureTypePanel):
+class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel):
     bl_label = "Clouds"
     tex_type = 'CLOUDS'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -481,7 +481,7 @@ class TEXTURE_PT_clouds(TextureTypePanel):
         col.prop(tex, "nabla", text="Nabla")
 
 
-class TEXTURE_PT_wood(TextureTypePanel):
+class TEXTURE_PT_wood(TextureTypePanel, bpy.types.Panel):
     bl_label = "Wood"
     tex_type = 'WOOD'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -518,7 +518,7 @@ class TEXTURE_PT_wood(TextureTypePanel):
         col.prop(tex, "nabla")
 
 
-class TEXTURE_PT_marble(TextureTypePanel):
+class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel):
     bl_label = "Marble"
     tex_type = 'MARBLE'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -550,7 +550,7 @@ class TEXTURE_PT_marble(TextureTypePanel):
         col.prop(tex, "nabla")
 
 
-class TEXTURE_PT_magic(TextureTypePanel):
+class TEXTURE_PT_magic(TextureTypePanel, bpy.types.Panel):
     bl_label = "Magic"
     tex_type = 'MAGIC'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -571,7 +571,7 @@ class TEXTURE_PT_magic(TextureTypePanel):
         col.prop(tex, "turbulence")
 
 
-class TEXTURE_PT_blend(TextureTypePanel):
+class TEXTURE_PT_blend(TextureTypePanel, bpy.types.Panel):
     bl_label = "Blend"
     tex_type = 'BLEND'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -593,7 +593,7 @@ class TEXTURE_PT_blend(TextureTypePanel):
         sub.prop(tex, "flip_axis", expand=True)
 
 
-class TEXTURE_PT_stucci(TextureTypePanel):
+class TEXTURE_PT_stucci(TextureTypePanel, bpy.types.Panel):
     bl_label = "Stucci"
     tex_type = 'STUCCI'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -622,7 +622,7 @@ class TEXTURE_PT_stucci(TextureTypePanel):
         col.prop(tex, "turbulence")
 
 
-class TEXTURE_PT_image(TextureTypePanel):
+class TEXTURE_PT_image(TextureTypePanel, bpy.types.Panel):
     bl_label = "Image"
     tex_type = 'IMAGE'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -648,7 +648,7 @@ def texture_filter_common(tex, layout):
     layout.prop(tex, "filter_size_minimum")
 
 
-class TEXTURE_PT_image_sampling(TextureTypePanel):
+class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
     bl_label = "Image Sampling"
     bl_default_closed = True
     tex_type = 'IMAGE'
@@ -689,7 +689,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
         texture_filter_common(tex, col)
 
 
-class TEXTURE_PT_image_mapping(TextureTypePanel):
+class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel):
     bl_label = "Image Mapping"
     bl_default_closed = True
     tex_type = 'IMAGE'
@@ -748,7 +748,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
         col.prop(tex, "crop_max_y", text="Y")
 
 
-class TEXTURE_PT_plugin(TextureTypePanel):
+class TEXTURE_PT_plugin(TextureTypePanel, bpy.types.Panel):
     bl_label = "Plugin"
     tex_type = 'PLUGIN'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -761,7 +761,7 @@ class TEXTURE_PT_plugin(TextureTypePanel):
         layout.label(text="Nothing yet")
 
 
-class TEXTURE_PT_envmap(TextureTypePanel):
+class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel):
     bl_label = "Environment Map"
     tex_type = 'ENVIRONMENT_MAP'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -802,7 +802,7 @@ class TEXTURE_PT_envmap(TextureTypePanel):
             col.prop(env, "clip_end", text="End")
 
 
-class TEXTURE_PT_envmap_sampling(TextureTypePanel):
+class TEXTURE_PT_envmap_sampling(TextureTypePanel, bpy.types.Panel):
     bl_label = "Environment Map Sampling"
     bl_default_closed = True
     tex_type = 'ENVIRONMENT_MAP'
@@ -816,7 +816,7 @@ class TEXTURE_PT_envmap_sampling(TextureTypePanel):
         texture_filter_common(tex, layout)
 
 
-class TEXTURE_PT_musgrave(TextureTypePanel):
+class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel):
     bl_label = "Musgrave"
     tex_type = 'MUSGRAVE'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -864,7 +864,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel):
         col.prop(tex, "nabla")
 
 
-class TEXTURE_PT_voronoi(TextureTypePanel):
+class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel):
     bl_label = "Voronoi"
     tex_type = 'VORONOI'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -908,7 +908,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel):
         col.prop(tex, "nabla")
 
 
-class TEXTURE_PT_distortednoise(TextureTypePanel):
+class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel):
     bl_label = "Distorted Noise"
     tex_type = 'DISTORTED_NOISE'
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -937,7 +937,7 @@ class TEXTURE_PT_distortednoise(TextureTypePanel):
         col.prop(tex, "nabla")
 
 
-class TEXTURE_PT_voxeldata(TextureButtonsPanel):
+class TEXTURE_PT_voxeldata(TextureButtonsPanel, bpy.types.Panel):
     bl_label = "Voxel Data"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -975,7 +975,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel):
         layout.prop(vd, "intensity")
 
 
-class TEXTURE_PT_pointdensity(TextureButtonsPanel):
+class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel):
     bl_label = "Point Density"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -1035,7 +1035,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel):
             col.prop(pd, "falloff_softness")
 
 
-class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
+class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel):
     bl_label = "Turbulence"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -1076,49 +1076,12 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
         col.prop(pd, "turbulence_strength")
 
 
-classes = [
-    TEXTURE_MT_specials,
-    TEXTURE_MT_envmap_specials,
-
-    TEXTURE_PT_context_texture,
-    TEXTURE_PT_preview,
-
-    TEXTURE_PT_clouds, # Texture Type Panels
-    TEXTURE_PT_wood,
-    TEXTURE_PT_marble,
-    TEXTURE_PT_magic,
-    TEXTURE_PT_blend,
-    TEXTURE_PT_stucci,
-    TEXTURE_PT_image,
-    TEXTURE_PT_image_sampling,
-    TEXTURE_PT_image_mapping,
-    TEXTURE_PT_plugin,
-    TEXTURE_PT_envmap,
-    TEXTURE_PT_envmap_sampling,
-    TEXTURE_PT_musgrave,
-    TEXTURE_PT_voronoi,
-    TEXTURE_PT_distortednoise,
-    TEXTURE_PT_voxeldata,
-    TEXTURE_PT_pointdensity,
-    TEXTURE_PT_pointdensity_turbulence,
-
-    TEXTURE_PT_colors,
-    TEXTURE_PT_mapping,
-    TEXTURE_PT_influence,
-
-    TEXTURE_PT_custom_props]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 22acd49f897b186bb06935e46b1862d7b87b8554..fe1c085dc020a87a264340180e82d8436441ffca 100644 (file)
@@ -23,7 +23,7 @@ from rna_prop_ui import PropertyPanel
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
-class WorldButtonsPanel(bpy.types.Panel):
+class WorldButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "world"
@@ -34,7 +34,7 @@ class WorldButtonsPanel(bpy.types.Panel):
         return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
 
 
-class WORLD_PT_preview(WorldButtonsPanel):
+class WORLD_PT_preview(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Preview"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -42,7 +42,7 @@ class WORLD_PT_preview(WorldButtonsPanel):
         self.layout.template_preview(context.world)
 
 
-class WORLD_PT_context_world(WorldButtonsPanel):
+class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel):
     bl_label = ""
     bl_show_header = False
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -70,12 +70,12 @@ class WORLD_PT_context_world(WorldButtonsPanel):
             layout.template_ID(scene, "world", new="world.new")
 
 
-class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel):
+class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, bpy.types.Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER'}
     _context_path = "world"
 
 
-class WORLD_PT_world(WorldButtonsPanel):
+class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "World"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -103,7 +103,7 @@ class WORLD_PT_world(WorldButtonsPanel):
         row.column().prop(world, "ambient_color")
 
 
-class WORLD_PT_mist(WorldButtonsPanel):
+class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Mist"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -134,7 +134,7 @@ class WORLD_PT_mist(WorldButtonsPanel):
         layout.prop(world.mist, "falloff")
 
 
-class WORLD_PT_stars(WorldButtonsPanel):
+class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Stars"
     bl_default_closed = True
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -163,7 +163,7 @@ class WORLD_PT_stars(WorldButtonsPanel):
         col.prop(world.stars, "average_separation", text="Separation")
 
 
-class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
+class WORLD_PT_ambient_occlusion(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Ambient Occlusion"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -182,7 +182,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
         split.prop(light, "ao_blend_mode", text="")
 
 
-class WORLD_PT_environment_lighting(WorldButtonsPanel):
+class WORLD_PT_environment_lighting(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Environment Lighting"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -201,7 +201,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel):
         split.prop(light, "environment_color", text="")
 
 
-class WORLD_PT_indirect_lighting(WorldButtonsPanel):
+class WORLD_PT_indirect_lighting(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Indirect Lighting"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -224,7 +224,7 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel):
         split.prop(light, "indirect_bounces", text="Bounces")
 
 
-class WORLD_PT_gather(WorldButtonsPanel):
+class WORLD_PT_gather(WorldButtonsPanel, bpy.types.Panel):
     bl_label = "Gather"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
@@ -272,30 +272,12 @@ class WORLD_PT_gather(WorldButtonsPanel):
             col.prop(light, "correction")
 
 
-classes = [
-    WORLD_PT_context_world,
-    WORLD_PT_preview,
-    WORLD_PT_world,
-    WORLD_PT_ambient_occlusion,
-    WORLD_PT_environment_lighting,
-    WORLD_PT_indirect_lighting,
-    WORLD_PT_gather,
-    WORLD_PT_mist,
-    WORLD_PT_stars,
-
-    WORLD_PT_custom_props]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 512af350a47c5a7a92a28e7ac74ea10a4f4d1345..f2c757adaf5f4994d30846582f0d70edcf01700e 100644 (file)
@@ -196,31 +196,12 @@ class ConsoleLanguage(bpy.types.Operator):
         return {'FINISHED'}
 
 
-classes = [
-    CONSOLE_HT_header,
-    CONSOLE_MT_console,
-    CONSOLE_MT_report,
-    CONSOLE_MT_language,
-
-    # Stubs that call the language operators
-    ConsoleExec,
-    ConsoleAutocomplete,
-    ConsoleBanner,
-
-    # Set the language and call the banner
-    ConsoleLanguage]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 41917acd997f60c33b85df27d1dfb3f1c010b8aa..f7e7ee724d7f04d27ad26a5326ffc81c9064188a 100644 (file)
@@ -196,25 +196,12 @@ class DOPESHEET_MT_key_transform(bpy.types.Menu):
         layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE'
 
 
-classes = [
-    DOPESHEET_HT_header, # header/menu classes
-    DOPESHEET_MT_view,
-    DOPESHEET_MT_select,
-    DOPESHEET_MT_channel,
-    DOPESHEET_MT_key,
-    DOPESHEET_MT_key_transform]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 39bae6ca59beedaf6a1c58844ad1d90e114fbbaa..a67bffc37c563300dd18ddeeafa1c4d9d804b083 100644 (file)
@@ -65,20 +65,12 @@ class FILEBROWSER_HT_header(bpy.types.Header):
         row.prop(params, "filter_text", text="")
 
 
-classes = [
-    FILEBROWSER_HT_header]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 1533b89120202c49354fc58ec56ef78356ff7be7..7eb728cc668a0adafdb20643efb739f9d52fa8af 100644 (file)
@@ -204,25 +204,12 @@ class GRAPH_MT_key_transform(bpy.types.Menu):
         layout.operator("transform.resize", text="Scale")
 
 
-classes = [
-    GRAPH_HT_header, # header/menu classes
-    GRAPH_MT_view,
-    GRAPH_MT_select,
-    GRAPH_MT_channel,
-    GRAPH_MT_key,
-    GRAPH_MT_key_transform]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index a28ddb90a40046163454174777f7c9a93d729d09..a51d237019afd0e14436edbec309061bdd850774 100644 (file)
@@ -674,41 +674,12 @@ class IMAGE_PT_paint_curve(bpy.types.Panel):
         row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
         row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
 
-classes = [
-    IMAGE_MT_view,
-    IMAGE_MT_select,
-    IMAGE_MT_image,
-    IMAGE_MT_uvs_showhide,
-    IMAGE_MT_uvs_transform,
-    IMAGE_MT_uvs_snap,
-    IMAGE_MT_uvs_mirror,
-    IMAGE_MT_uvs_weldalign,
-    IMAGE_MT_uvs,
-    IMAGE_HT_header,
-    IMAGE_PT_image_properties,
-    IMAGE_PT_paint,
-    IMAGE_PT_tools_brush_texture,
-    IMAGE_PT_paint_stroke,
-    IMAGE_PT_paint_curve,
-    IMAGE_PT_game_properties,
-    IMAGE_PT_view_properties,
-    IMAGE_PT_view_histogram,
-    IMAGE_PT_view_waveform,
-    IMAGE_PT_view_vectorscope,
-    IMAGE_PT_sample_line,
-    IMAGE_PT_scope_sample]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 25f4e8b20978989a720ccf88162134e2bcab1b6f..618cd3c51c9294a83690c81a48320eafcd83a0ea 100644 (file)
@@ -354,34 +354,13 @@ class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
         return {'FINISHED'}
 
 
-classes = [
-    INFO_HT_header,
-    INFO_MT_file,
-    INFO_MT_file_import,
-    INFO_MT_file_export,
-    INFO_MT_file_external_data,
-    INFO_MT_add,
-    INFO_MT_mesh_add,
-    INFO_MT_curve_add,
-    INFO_MT_surface_add,
-    INFO_MT_armature_add,
-    INFO_MT_game,
-    INFO_MT_render,
-    INFO_MT_help,
-
-    HELP_OT_operator_cheat_sheet]
-
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 6003c4d4bd784009526747c3617ed6a03001ec85..4a70695024a169cce39f7ad892423e8c63ddf98b 100644 (file)
@@ -88,24 +88,12 @@ class LOGIC_MT_view(bpy.types.Menu):
         layout.operator("logic.properties", icon='MENU_PANEL')
 
 
-classes = [
-    LOGIC_HT_header,
-    LOGIC_MT_view,
-    
-    LOGIC_PT_properties,
-    LOGIC_MT_logicbricks_add]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 0eb342d4b158f8ce9d25a9eaede6abb879e9d22d..1141a640534e1c2fdc9ed59ce9bcc36a268af375 100644 (file)
@@ -159,25 +159,12 @@ class NLA_MT_edit_transform(bpy.types.Menu):
         layout.operator("transform.resize", text="Scale")
 
 
-classes = [
-    NLA_HT_header, # header/menu classes
-    NLA_MT_view,
-    NLA_MT_select,
-    NLA_MT_edit,
-    NLA_MT_add,
-    NLA_MT_edit_transform]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 21b2ebc5390889b40ede4677db70eaf510519a77..0a3cebf5faa7d24a602e2d142dfbcc02109548df 100644 (file)
@@ -160,23 +160,12 @@ class NODE_MT_node(bpy.types.Menu):
         layout.operator("node.show_cyclic_dependencies")
 
 
-classes = [
-    NODE_HT_header,
-    NODE_MT_view,
-    NODE_MT_select,
-    NODE_MT_node]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index ec3c430feaa655d803c8f9065cfe106f94d1c463..6b2743027baba77b049a07419a98ff62727950ef 100644 (file)
@@ -117,23 +117,12 @@ class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
         col.operator("outliner.drivers_delete_selected")
 
 
-classes = [
-    OUTLINER_HT_header,
-    OUTLINER_MT_view,
-    OUTLINER_MT_search,
-    OUTLINER_MT_edit_datablocks]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index adf80635bc1cae7977b13e6d348cac96aeef765b..abae5f23f6b892360a0322fabe4994cfd5e285d7 100644 (file)
@@ -312,7 +312,7 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
         layout.operator("sequencer.swap_data")
 
 
-class SequencerButtonsPanel(bpy.types.Panel):
+class SequencerButtonsPanel():
     bl_space_type = 'SEQUENCE_EDITOR'
     bl_region_type = 'UI'
 
@@ -323,7 +323,7 @@ class SequencerButtonsPanel(bpy.types.Panel):
         return self.has_sequencer(context) and (act_strip(context) is not None)
 
 
-class SequencerButtonsPanel_Output(bpy.types.Panel):
+class SequencerButtonsPanel_Output():
     bl_space_type = 'SEQUENCE_EDITOR'
     bl_region_type = 'UI'
 
@@ -334,7 +334,7 @@ class SequencerButtonsPanel_Output(bpy.types.Panel):
         return self.has_preview(context)
 
 
-class SEQUENCER_PT_edit(SequencerButtonsPanel):
+class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel):
     bl_label = "Edit Strip"
 
     def draw(self, context):
@@ -381,7 +381,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel):
         col.label(text="Frame Still %d:%d" % (strip.frame_still_start, strip.frame_still_end))
 
 
-class SEQUENCER_PT_effect(SequencerButtonsPanel):
+class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel):
     bl_label = "Effect Strip"
 
     def poll(self, context):
@@ -510,7 +510,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
         col.prop(strip, "rotation_start", text="Rotation")
 
 
-class SEQUENCER_PT_input(SequencerButtonsPanel):
+class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel):
     bl_label = "Strip Input"
 
     def poll(self, context):
@@ -635,8 +635,7 @@ class SEQUENCER_PT_input_secondary(SEQUENCER_PT_input):
     def draw_filename(self, context):
         pass
 
-
-class SEQUENCER_PT_sound(SequencerButtonsPanel):
+class SEQUENCER_PT_sound(SequencerButtonsPanel, bpy.types.Panel):
     bl_label = "Sound"
 
     def poll(self, context):
@@ -676,7 +675,7 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel):
         col.prop(strip, "animation_end_offset", text="End")
 
 
-class SEQUENCER_PT_scene(SequencerButtonsPanel):
+class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel):
     bl_label = "Scene"
 
     def poll(self, context):
@@ -700,7 +699,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel):
         layout.template_ID(strip, "scene_camera")
 
 
-class SEQUENCER_PT_filter(SequencerButtonsPanel):
+class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel):
     bl_label = "Filter"
 
     def poll(self, context):
@@ -761,7 +760,7 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel):
             col.prop(strip.color_balance, "inverse_gain", text="Inverse")
 
 
-class SEQUENCER_PT_proxy(SequencerButtonsPanel):
+class SEQUENCER_PT_proxy(SequencerButtonsPanel, bpy.types.Panel):
     bl_label = "Proxy"
 
     def poll(self, context):
@@ -794,7 +793,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel):
                 flow.prop(strip.proxy, "filepath")
 
 
-class SEQUENCER_PT_preview(SequencerButtonsPanel_Output):
+class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, bpy.types.Panel):
     bl_label = "Scene Preview/Render"
     bl_space_type = 'SEQUENCE_EDITOR'
     bl_region_type = 'UI'
@@ -818,7 +817,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output):
         '''
 
 
-class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
+class SEQUENCER_PT_view(SequencerButtonsPanel_Output, bpy.types.Panel):
     bl_label = "View Settings"
 
     def draw(self, context):
@@ -834,40 +833,12 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
             col.prop(st, "separate_color_preview")
         col.prop(st, "proxy_render_size")
 
-classes = [
-    SEQUENCER_HT_header, # header/menu classes
-    SEQUENCER_MT_view,
-    SEQUENCER_MT_view_toggle,
-    SEQUENCER_MT_select,
-    SEQUENCER_MT_marker,
-    SEQUENCER_MT_add,
-    SEQUENCER_MT_add_effect,
-    SEQUENCER_MT_strip,
-
-    SEQUENCER_PT_edit, # sequencer panels
-    SEQUENCER_PT_effect,
-    SEQUENCER_PT_input_movie,
-    SEQUENCER_PT_input_image,
-    SEQUENCER_PT_input_secondary,
-    SEQUENCER_PT_sound,
-    SEQUENCER_PT_scene,
-    SEQUENCER_PT_filter,
-    SEQUENCER_PT_proxy,
-
-    SEQUENCER_PT_preview,
-    SEQUENCER_PT_view] # view panels
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 552621d87c6cfbca6317f85ccba3686b3c089dfe..29a5674d377b7e8710e75dcdeeb79f02bb0330a0 100644 (file)
@@ -297,33 +297,12 @@ class TEXT_MT_toolbox(bpy.types.Menu):
 
         layout.operator("text.run_script")
 
-
-classes = [
-    TEXT_HT_header,
-    TEXT_PT_properties,
-    TEXT_PT_find,
-    TEXT_MT_view,
-    TEXT_MT_text,
-    TEXT_MT_templates,
-    TEXT_MT_format,
-    TEXT_MT_edit,
-    TEXT_MT_edit_view,
-    TEXT_MT_edit_select,
-    TEXT_MT_edit_markers,
-    TEXT_MT_edit_to3d,
-    TEXT_MT_toolbox]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 8c24dbc2d9c36467c251c383930bfdf0f3d4b3f1..3825d774f1ee25f84f017dcedc27cfff0cdacc3b 100644 (file)
@@ -192,25 +192,12 @@ class TIME_MT_autokey(bpy.types.Menu):
         layout.prop_enum(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
         layout.prop_enum(tools, "autokey_mode", 'REPLACE_KEYS')
 
-classes = [
-    TIME_HT_header,
-    TIME_MT_view,
-    TIME_MT_cache,
-    TIME_MT_frame,
-    TIME_MT_autokey,
-    TIME_MT_playback]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 2c040168490b64d9ba6c87dcd316cf8bb9b79439..f31f976e653c44a33ff620f01f114c77cc70f156 100644 (file)
@@ -1129,36 +1129,11 @@ class WM_OT_addon_expand(bpy.types.Operator):
         return {'FINISHED'}
 
 
-classes = [
-    USERPREF_HT_header,
-    USERPREF_PT_tabs,
-    USERPREF_PT_interface,
-    USERPREF_PT_theme,
-    USERPREF_PT_edit,
-    USERPREF_PT_system,
-    USERPREF_PT_file,
-    USERPREF_PT_input,
-    USERPREF_PT_addons,
-
-    USERPREF_MT_interaction_presets,
-    USERPREF_MT_splash,
-
-    WM_OT_addon_enable,
-    WM_OT_addon_disable,
-    WM_OT_addon_install,
-    WM_OT_addon_expand]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
-
+    pass
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index c93b24d5cb27b0c7456bbd7eef601c854a80d76a..a76b7249d5d1fc5fcbc118ece4b0e64988fb0c71 100644 (file)
@@ -784,29 +784,11 @@ class WM_OT_keyconfig_remove(bpy.types.Operator):
         wm.remove_keyconfig(keyconfig)
         return {'FINISHED'}
 
-
-classes = [
-    WM_OT_keyconfig_export,
-    WM_OT_keyconfig_import,
-    WM_OT_keyconfig_test,
-    WM_OT_keyconfig_remove,
-    WM_OT_keymap_edit,
-    WM_OT_keymap_restore,
-    WM_OT_keyitem_add,
-    WM_OT_keyitem_remove,
-    WM_OT_keyitem_restore]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
-
+    pass
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index 7b59b00dc566a0a6afde5dff88969b45055dd15b..8cc3669014b283fc1becdbd5053203625a61b177 100644 (file)
@@ -75,11 +75,16 @@ class VIEW3D_HT_header(bpy.types.Header):
                 row.prop(view, "occlude_geometry", text="")
 
             # Proportional editing
-            if obj.mode in ('OBJECT', 'EDIT', 'PARTICLE_EDIT'):
+            if obj.mode in ('EDIT', 'PARTICLE_EDIT'):
                 row = layout.row(align=True)
                 row.prop(toolsettings, "proportional_editing", text="", icon_only=True)
                 if toolsettings.proportional_editing != 'DISABLED':
                     row.prop(toolsettings, "proportional_editing_falloff", text="", icon_only=True)
+            elif obj.mode == 'OBJECT':
+                row = layout.row(align=True)
+                row.prop(toolsettings, "proportional_editing_objects", text="", icon_only=True)
+                if toolsettings.proportional_editing_objects:
+                    row.prop(toolsettings, "proportional_editing_falloff", text="", icon_only=True)
 
         # Snap
         row = layout.row(align=True)
@@ -114,7 +119,7 @@ class VIEW3D_HT_header(bpy.types.Header):
 # ********** Utilities **********
 
 
-class VIEW3D_MT_showhide(bpy.types.Menu):
+class ShowHideMenu():
     bl_label = "Show/Hide"
     _operator_name = ""
 
@@ -1086,7 +1091,7 @@ class VIEW3D_MT_particle_specials(bpy.types.Menu):
         layout.operator("particle.remove_doubles")
 
 
-class VIEW3D_MT_particle_showhide(VIEW3D_MT_showhide):
+class VIEW3D_MT_particle_showhide(ShowHideMenu, bpy.types.Menu):
     _operator_name = "particle"
 
 # ********** Pose Menu **********
@@ -1236,7 +1241,7 @@ class VIEW3D_MT_pose_constraints(bpy.types.Menu):
         layout.operator("pose.constraints_clear")
 
 
-class VIEW3D_MT_pose_showhide(VIEW3D_MT_showhide):
+class VIEW3D_MT_pose_showhide(ShowHideMenu, bpy.types.Menu):
     _operator_name = "pose"
 
 
@@ -1602,7 +1607,7 @@ class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu):
         layout.operator("mesh.flip_normals")
 
 
-class VIEW3D_MT_edit_mesh_showhide(VIEW3D_MT_showhide):
+class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, bpy.types.Menu):
     _operator_name = "mesh"
 
 # Edit Curve
@@ -1694,7 +1699,7 @@ class VIEW3D_MT_edit_curve_specials(bpy.types.Menu):
         layout.operator("curve.smooth_radius")
 
 
-class VIEW3D_MT_edit_curve_showhide(VIEW3D_MT_showhide):
+class VIEW3D_MT_edit_curve_showhide(ShowHideMenu, bpy.types.Menu):
     _operator_name = "curve"
 
 
@@ -2269,123 +2274,13 @@ class VIEW3D_PT_context_properties(bpy.types.Panel):
             # Draw with no edit button
             rna_prop_ui.draw(self.layout, context, member, False)
 
-classes = [
-    VIEW3D_OT_edit_mesh_extrude_move, # detects constraints setup and extrude region
-    VIEW3D_OT_edit_mesh_extrude_individual_move,
-
-    VIEW3D_HT_header, # Header
-
-    VIEW3D_MT_view, #View Menus
-    VIEW3D_MT_view_navigation,
-    VIEW3D_MT_view_align,
-    VIEW3D_MT_view_align_selected,
-    VIEW3D_MT_view_cameras,
-
-    VIEW3D_MT_select_object, # Select Menus
-    VIEW3D_MT_select_pose,
-    VIEW3D_MT_select_particle,
-    VIEW3D_MT_select_edit_mesh,
-    VIEW3D_MT_select_edit_curve,
-    VIEW3D_MT_select_edit_surface,
-    VIEW3D_MT_select_edit_metaball,
-    VIEW3D_MT_select_edit_lattice,
-    VIEW3D_MT_select_edit_armature,
-    VIEW3D_MT_select_face, # XXX todo
-
-    VIEW3D_MT_transform, # Object/Edit Menus
-    VIEW3D_MT_mirror, # Object/Edit Menus
-    VIEW3D_MT_snap, # Object/Edit Menus
-    VIEW3D_MT_uv_map, # Edit Menus
-
-    VIEW3D_MT_object, # Object Menu
-    VIEW3D_MT_object_specials,
-    VIEW3D_MT_object_apply,
-    VIEW3D_MT_object_clear,
-    VIEW3D_MT_object_parent,
-    VIEW3D_MT_object_track,
-    VIEW3D_MT_object_group,
-    VIEW3D_MT_object_constraints,
-    VIEW3D_MT_object_showhide,
-    VIEW3D_MT_make_single_user,
-    VIEW3D_MT_make_links,
-    VIEW3D_MT_object_game_properties,
-    VIEW3D_MT_object_game_logicbricks,
-
-    VIEW3D_MT_hook,
-    VIEW3D_MT_vertex_group,
-
-    VIEW3D_MT_sculpt, # Sculpt Menu
-    VIEW3D_MT_paint_vertex,
-    VIEW3D_MT_paint_weight,
-
-    VIEW3D_MT_particle, # Particle Menu
-    VIEW3D_MT_particle_specials,
-    VIEW3D_MT_particle_showhide,
-
-    VIEW3D_MT_pose, # POSE Menu
-    VIEW3D_MT_pose_transform,
-    VIEW3D_MT_pose_pose,
-    VIEW3D_MT_pose_motion,
-    VIEW3D_MT_pose_group,
-    VIEW3D_MT_pose_ik,
-    VIEW3D_MT_pose_constraints,
-    VIEW3D_MT_pose_showhide,
-    VIEW3D_MT_pose_apply,
-
-    VIEW3D_MT_edit_mesh,
-    VIEW3D_MT_edit_mesh_specials, # Only as a menu for keybindings
-    VIEW3D_MT_edit_mesh_selection_mode, # Only as a menu for keybindings
-    VIEW3D_MT_edit_mesh_vertices,
-    VIEW3D_MT_edit_mesh_edges,
-    VIEW3D_MT_edit_mesh_faces,
-    VIEW3D_MT_edit_mesh_normals,
-    VIEW3D_MT_edit_mesh_showhide,
-    VIEW3D_MT_edit_mesh_extrude, # use with VIEW3D_OT_edit_mesh_extrude_menu
-
-    VIEW3D_MT_edit_curve,
-    VIEW3D_MT_edit_curve_ctrlpoints,
-    VIEW3D_MT_edit_curve_segments,
-    VIEW3D_MT_edit_curve_specials,
-    VIEW3D_MT_edit_curve_showhide,
-
-    VIEW3D_MT_edit_surface,
-
-    VIEW3D_MT_edit_text,
-    VIEW3D_MT_edit_text_chars,
-
-    VIEW3D_MT_edit_meta,
-    VIEW3D_MT_edit_meta_showhide,
-
-    VIEW3D_MT_edit_lattice,
-
-    VIEW3D_MT_edit_armature,
-    VIEW3D_MT_edit_armature_parent,
-    VIEW3D_MT_edit_armature_roll,
-
-    VIEW3D_MT_armature_specials, # Only as a menu for keybindings
-
-   # Panels
-    VIEW3D_PT_view3d_properties,
-    VIEW3D_PT_view3d_display,
-    VIEW3D_PT_view3d_name,
-    VIEW3D_PT_view3d_meshdisplay,
-    VIEW3D_PT_view3d_curvedisplay,
-    VIEW3D_PT_background_image,
-    VIEW3D_PT_transform_orientations,
-    VIEW3D_PT_etch_a_ton,
-    VIEW3D_PT_context_properties]
-
 
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
\ No newline at end of file
index ebf9f8e5af3c7ad2373c37506cf08baf314e8b15..34132069017a7f1f5b10b284b73b24e3a10aa85d 100644 (file)
@@ -21,7 +21,7 @@ import bpy
 
 narrowui = bpy.context.user_preferences.view.properties_width_check
 
-class View3DPanel(bpy.types.Panel):
+class View3DPanel():
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'TOOLS'
 
@@ -29,7 +29,7 @@ class View3DPanel(bpy.types.Panel):
 # ********** default tools for objectmode ****************
 
 
-class VIEW3D_PT_tools_objectmode(View3DPanel):
+class VIEW3D_PT_tools_objectmode(View3DPanel, bpy.types.Panel):
     bl_context = "objectmode"
     bl_label = "Object Tools"
 
@@ -79,7 +79,7 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
 # ********** default tools for editmode_mesh ****************
 
 
-class VIEW3D_PT_tools_meshedit(View3DPanel):
+class VIEW3D_PT_tools_meshedit(View3DPanel, bpy.types.Panel):
     bl_context = "mesh_edit"
     bl_label = "Mesh Tools"
 
@@ -147,7 +147,7 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
 
 
-class VIEW3D_PT_tools_meshedit_options(View3DPanel):
+class VIEW3D_PT_tools_meshedit_options(View3DPanel, bpy.types.Panel):
     bl_context = "mesh_edit"
     bl_label = "Mesh Options"
 
@@ -166,7 +166,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel):
 # ********** default tools for editmode_curve ****************
 
 
-class VIEW3D_PT_tools_curveedit(View3DPanel):
+class VIEW3D_PT_tools_curveedit(View3DPanel, bpy.types.Panel):
     bl_context = "curve_edit"
     bl_label = "Curve Tools"
 
@@ -220,7 +220,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel):
 # ********** default tools for editmode_surface ****************
 
 
-class VIEW3D_PT_tools_surfaceedit(View3DPanel):
+class VIEW3D_PT_tools_surfaceedit(View3DPanel, bpy.types.Panel):
     bl_context = "surface_edit"
     bl_label = "Surface Tools"
 
@@ -260,7 +260,7 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel):
 # ********** default tools for editmode_text ****************
 
 
-class VIEW3D_PT_tools_textedit(View3DPanel):
+class VIEW3D_PT_tools_textedit(View3DPanel, bpy.types.Panel):
     bl_context = "text_edit"
     bl_label = "Text Tools"
 
@@ -293,7 +293,7 @@ class VIEW3D_PT_tools_textedit(View3DPanel):
 # ********** default tools for editmode_armature ****************
 
 
-class VIEW3D_PT_tools_armatureedit(View3DPanel):
+class VIEW3D_PT_tools_armatureedit(View3DPanel, bpy.types.Panel):
     bl_context = "armature_edit"
     bl_label = "Armature Tools"
 
@@ -330,7 +330,7 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel):
         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
 
 
-class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
+class VIEW3D_PT_tools_armatureedit_options(View3DPanel, bpy.types.Panel):
     bl_context = "armature_edit"
     bl_label = "Armature Options"
 
@@ -345,7 +345,7 @@ class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
 # ********** default tools for editmode_mball ****************
 
 
-class VIEW3D_PT_tools_mballedit(View3DPanel):
+class VIEW3D_PT_tools_mballedit(View3DPanel, bpy.types.Panel):
     bl_context = "mball_edit"
     bl_label = "Meta Tools"
 
@@ -373,7 +373,7 @@ class VIEW3D_PT_tools_mballedit(View3DPanel):
 # ********** default tools for editmode_lattice ****************
 
 
-class VIEW3D_PT_tools_latticeedit(View3DPanel):
+class VIEW3D_PT_tools_latticeedit(View3DPanel, bpy.types.Panel):
     bl_context = "lattice_edit"
     bl_label = "Lattice Tools"
 
@@ -405,7 +405,7 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel):
 # ********** default tools for posemode ****************
 
 
-class VIEW3D_PT_tools_posemode(View3DPanel):
+class VIEW3D_PT_tools_posemode(View3DPanel, bpy.types.Panel):
     bl_context = "posemode"
     bl_label = "Pose Tools"
 
@@ -453,7 +453,7 @@ class VIEW3D_PT_tools_posemode(View3DPanel):
         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
 
 
-class VIEW3D_PT_tools_posemode_options(View3DPanel):
+class VIEW3D_PT_tools_posemode_options(View3DPanel, bpy.types.Panel):
     bl_context = "posemode"
     bl_label = "Pose Options"
 
@@ -469,7 +469,7 @@ class VIEW3D_PT_tools_posemode_options(View3DPanel):
 # ********** default tools for paint modes ****************
 
 
-class PaintPanel(bpy.types.Panel):
+class PaintPanel():
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'TOOLS'
 
@@ -490,7 +490,7 @@ class PaintPanel(bpy.types.Panel):
         return False
 
 
-class VIEW3D_PT_tools_brush(PaintPanel):
+class VIEW3D_PT_tools_brush(PaintPanel, bpy.types.Panel):
     bl_label = "Brush"
 
     def poll(self, context):
@@ -735,7 +735,7 @@ class VIEW3D_PT_tools_brush(PaintPanel):
             #row.prop(brush, "use_jitter_pressure", toggle=True, text="")
 
 
-class VIEW3D_PT_tools_brush_texture(PaintPanel):
+class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel):
     bl_label = "Texture"
     bl_default_closed = True
 
@@ -837,7 +837,7 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel):
             col.active = tex_slot.map_mode in ('FIXED', 'TILED') and brush.use_texture_overlay
 
 
-class VIEW3D_PT_tools_brush_tool(PaintPanel):
+class VIEW3D_PT_tools_brush_tool(PaintPanel, bpy.types.Panel):
     bl_label = "Tool"
     bl_default_closed = True
 
@@ -866,7 +866,7 @@ class VIEW3D_PT_tools_brush_tool(PaintPanel):
             col.prop(brush, "vertexpaint_tool", expand=False, text="")
 
 
-class VIEW3D_PT_tools_brush_stroke(PaintPanel):
+class VIEW3D_PT_tools_brush_stroke(PaintPanel, bpy.types.Panel):
     bl_label = "Stroke"
     bl_default_closed = True
 
@@ -963,7 +963,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel):
             #    row.prop(brush, "use_spacing_pressure", toggle=True, text="")
 
 
-class VIEW3D_PT_tools_brush_curve(PaintPanel):
+class VIEW3D_PT_tools_brush_curve(PaintPanel, bpy.types.Panel):
     bl_label = "Curve"
     bl_default_closed = True
 
@@ -987,7 +987,7 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel):
         row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
         row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
 
-class VIEW3D_PT_sculpt_options(PaintPanel):
+class VIEW3D_PT_sculpt_options(PaintPanel, bpy.types.Panel):
     bl_label = "Options"
     bl_default_closed = True
 
@@ -1105,7 +1105,7 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel):
 # ********** default tools for weightpaint ****************
 
 
-class VIEW3D_PT_tools_weightpaint(View3DPanel):
+class VIEW3D_PT_tools_weightpaint(View3DPanel, bpy.types.Panel):
     bl_context = "weightpaint"
     bl_label = "Weight Tools"
 
@@ -1120,7 +1120,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel):
         col.operator("object.vertex_group_levels", text="Levels")
 
 
-class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
+class VIEW3D_PT_tools_weightpaint_options(View3DPanel, bpy.types.Panel):
     bl_context = "weightpaint"
     bl_label = "Options"
 
@@ -1157,7 +1157,7 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
 # ********** default tools for vertexpaint ****************
 
 
-class VIEW3D_PT_tools_vertexpaint(View3DPanel):
+class VIEW3D_PT_tools_vertexpaint(View3DPanel, bpy.types.Panel):
     bl_context = "vertexpaint"
     bl_label = "Options"
 
@@ -1186,7 +1186,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
 # ********** default tools for texturepaint ****************
 
 
-class VIEW3D_PT_tools_projectpaint(View3DPanel):
+class VIEW3D_PT_tools_projectpaint(View3DPanel, bpy.types.Panel):
     bl_context = "texturepaint"
     bl_label = "Project Paint"
 
@@ -1294,7 +1294,7 @@ class VIEW3D_MT_tools_projectpaint_stencil(bpy.types.Menu):
             prop.value = i
 
 
-class VIEW3D_PT_tools_particlemode(View3DPanel):
+class VIEW3D_PT_tools_particlemode(View3DPanel, bpy.types.Panel):
     '''default tools for particle mode'''
     bl_context = "particlemode"
     bl_label = "Options"
@@ -1361,49 +1361,12 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
             sub.prop(pe, "fade_frames", slider=True)
 
 
-classes = [
-    VIEW3D_PT_tools_weightpaint,
-    VIEW3D_PT_tools_objectmode,
-    VIEW3D_PT_tools_meshedit,
-    VIEW3D_PT_tools_meshedit_options,
-    VIEW3D_PT_tools_curveedit,
-    VIEW3D_PT_tools_surfaceedit,
-    VIEW3D_PT_tools_textedit,
-    VIEW3D_PT_tools_armatureedit,
-    VIEW3D_PT_tools_armatureedit_options,
-    VIEW3D_PT_tools_mballedit,
-    VIEW3D_PT_tools_latticeedit,
-    VIEW3D_PT_tools_posemode,
-    VIEW3D_PT_tools_posemode_options,
-    VIEW3D_PT_tools_brush,
-    VIEW3D_PT_tools_brush_texture,
-    VIEW3D_PT_tools_brush_stroke,
-    VIEW3D_PT_tools_brush_curve,
-    VIEW3D_PT_tools_brush_appearance,
-    VIEW3D_PT_tools_brush_tool,
-    VIEW3D_PT_sculpt_symmetry,
-    VIEW3D_PT_sculpt_options,
-    VIEW3D_PT_tools_vertexpaint,
-    VIEW3D_PT_tools_weightpaint_options,
-    VIEW3D_PT_imagepaint_options,
-
-    VIEW3D_PT_tools_projectpaint,
-    VIEW3D_MT_tools_projectpaint_clone,
-    VIEW3D_MT_tools_projectpaint_stencil,
-
-    VIEW3D_PT_tools_particlemode]
-
-
 def register():
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
+    pass
 
 
 def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
+    pass
 
 if __name__ == "__main__":
     register()
index d20f2a23664aa8f7bcdad6743104dd773feb2fc3..d0e321ade065dfaebd31d7dc13f26707073702df 100644 (file)
@@ -330,6 +330,8 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
                return 0;
        }
        
+       bpy_set_immediate_register(1);
+
        bpy_context_set(C, &gilstate);
 
        if (text) {
@@ -395,6 +397,8 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
        
        bpy_context_clear(C, &gilstate);
 
+       bpy_set_immediate_register(0);
+
        return py_result ? 1:0;
 }
 
index 8be9cc4cdaec0e0417d802dacdded667ade88d4f..8fc7fc2b3429be4333ebc44e7fc605d46ebf4b7c 100644 (file)
@@ -4175,9 +4175,11 @@ static PyObject *pyrna_basetype_getattro( BPy_BaseTypeRNA *self, PyObject *pynam
 static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self);
 static PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class);
 static PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *py_class);
+static PyObject *pyrna_register_immediate(PyObject *self);
 
 static struct PyMethodDef pyrna_basetype_methods[] = {
        {"__dir__", (PyCFunction)pyrna_basetype_dir, METH_NOARGS, ""},
+       {"immediate", (PyCFunction)pyrna_register_immediate, METH_NOARGS, ""},
        {"register", (PyCFunction)pyrna_basetype_register, METH_O, ""},
        {"unregister", (PyCFunction)pyrna_basetype_unregister, METH_O, ""},
        {NULL, NULL, 0, NULL}
@@ -4769,6 +4771,22 @@ void pyrna_free_types(void)
 
 }
 
+static int IMMEDIATE = 0;
+
+void bpy_set_immediate_register(int value)
+{
+       IMMEDIATE = value;
+}
+
+static PyObject *pyrna_register_immediate(PyObject *self)
+{
+       if (IMMEDIATE) {
+               Py_RETURN_TRUE;
+       } else {
+               Py_RETURN_FALSE;
+       }
+}
+
 /* Note! MemLeak XXX
  *
  * There is currently a bug where moving registering a python class does
index bd9838a76d412d2a77f74d8d9e639619e37c8309..32f2cd477d619c107f1e5bcb72d324423e8b9420 100644 (file)
@@ -86,6 +86,8 @@ int pyrna_set_to_enum_bitfield(EnumPropertyItem *items, PyObject *value, int *r_
 
 int pyrna_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *value, const char *error_prefix);
 
+void bpy_set_immediate_register(int value);
+
 int pyrna_deferred_register_props(struct StructRNA *srna, PyObject *class_dict);
 
 /* called before stopping python */