diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-11 02:48:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-11 02:48:22 +0300 |
commit | 4612034cf45f2534b01bb038f80b7795e8b8e20d (patch) | |
tree | ba47ff0cb8d4916faa8fb2ff06dbf08883fae9b3 /release/scripts/op | |
parent | 46bb5643b7660033bc0d15c5fcc752324a1b519f (diff) |
patch [#25809] Auto-Registration as utility function.
This removes auto-registration, committed by Martin r30961.
Realize this is a contentious topic but Brecht and myself both would rather opt-in registration.
TODO:
- addons need updating.
- class list will be modified to use weakrefs (should have been done for existing system too).
- will move bpy.types.(un)register functions into bpy.utils.(un)register_class, currently including these functions in a type list is internally ugly, scripts which loop over types also need to check for these.
Diffstat (limited to 'release/scripts/op')
-rw-r--r-- | release/scripts/op/animsys_update.py | 6 | ||||
-rw-r--r-- | release/scripts/op/fcurve_euler_filter.py | 5 | ||||
-rw-r--r-- | release/scripts/op/image.py | 4 | ||||
-rw-r--r-- | release/scripts/op/mesh.py | 4 | ||||
-rw-r--r-- | release/scripts/op/nla.py | 6 | ||||
-rw-r--r-- | release/scripts/op/object.py | 4 | ||||
-rw-r--r-- | release/scripts/op/object_align.py | 3 | ||||
-rw-r--r-- | release/scripts/op/object_randomize_transform.py | 3 | ||||
-rw-r--r-- | release/scripts/op/presets.py | 4 | ||||
-rw-r--r-- | release/scripts/op/screen_play_rendered_anim.py | 4 | ||||
-rw-r--r-- | release/scripts/op/sequencer.py | 4 | ||||
-rw-r--r-- | release/scripts/op/uv.py | 2 | ||||
-rw-r--r-- | release/scripts/op/uvcalc_follow_active.py | 3 | ||||
-rw-r--r-- | release/scripts/op/uvcalc_smart_project.py | 2 | ||||
-rw-r--r-- | release/scripts/op/vertexpaint_dirt.py | 4 | ||||
-rw-r--r-- | release/scripts/op/wm.py | 4 |
16 files changed, 38 insertions, 24 deletions
diff --git a/release/scripts/op/animsys_update.py b/release/scripts/op/animsys_update.py index e5eab045e94..9262ff40a37 100644 --- a/release/scripts/op/animsys_update.py +++ b/release/scripts/op/animsys_update.py @@ -701,4 +701,8 @@ if __name__ == "__main__": def register(): - pass + bpy.utils.register_module(__name__) + + +def unregister(): + bpy.utils.unregister_module(__name__) diff --git a/release/scripts/op/fcurve_euler_filter.py b/release/scripts/op/fcurve_euler_filter.py index 0e7f0b69eca..6332bbe309c 100644 --- a/release/scripts/op/fcurve_euler_filter.py +++ b/release/scripts/op/fcurve_euler_filter.py @@ -78,13 +78,12 @@ class DiscontFilterOp(bpy.types.Operator): main(context) return {'FINISHED'} - def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py index ddd04c4e7c3..e1d471f8254 100644 --- a/release/scripts/op/image.py +++ b/release/scripts/op/image.py @@ -195,11 +195,11 @@ class ProjectApply(bpy.types.Operator): def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() diff --git a/release/scripts/op/mesh.py b/release/scripts/op/mesh.py index 447de04f423..4906fd7fc6c 100644 --- a/release/scripts/op/mesh.py +++ b/release/scripts/op/mesh.py @@ -173,11 +173,11 @@ class MeshMirrorUV(bpy.types.Operator): def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() diff --git a/release/scripts/op/nla.py b/release/scripts/op/nla.py index d47668d68e3..5711fdf12e5 100644 --- a/release/scripts/op/nla.py +++ b/release/scripts/op/nla.py @@ -175,13 +175,11 @@ class BakeAction(bpy.types.Operator): def register(): - pass - # bpy.types.INFO_MT_mesh_add.append(menu_func) + bpy.utils.register_module(__name__) def unregister(): - pass - # bpy.types.INFO_MT_mesh_add.remove(menu_func) + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index 8fee6e2166d..92886689972 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -565,11 +565,11 @@ class ClearAllRestrictRender(bpy.types.Operator): def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() diff --git a/release/scripts/op/object_align.py b/release/scripts/op/object_align.py index 8654fb4db3d..d98fe584c1a 100644 --- a/release/scripts/op/object_align.py +++ b/release/scripts/op/object_align.py @@ -287,11 +287,14 @@ def menu_func(self, context): def register(): + bpy.utils.register_module(__name__) bpy.types.VIEW3D_MT_transform.append(menu_func) def unregister(): + bpy.utils.unregister_module(__name__) bpy.types.VIEW3D_MT_transform.remove(menu_func) + if __name__ == "__main__": register() diff --git a/release/scripts/op/object_randomize_transform.py b/release/scripts/op/object_randomize_transform.py index 8b8070f34bc..ee7a5f98b91 100644 --- a/release/scripts/op/object_randomize_transform.py +++ b/release/scripts/op/object_randomize_transform.py @@ -154,11 +154,14 @@ def menu_func(self, context): def register(): + bpy.utils.register_module(__name__) bpy.types.VIEW3D_MT_transform.append(menu_func) def unregister(): + bpy.utils.unregister_module(__name__) bpy.types.VIEW3D_MT_transform.remove(menu_func) + if __name__ == "__main__": register() diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py index 36170fb6283..65653aeee3e 100644 --- a/release/scripts/op/presets.py +++ b/release/scripts/op/presets.py @@ -354,11 +354,11 @@ class WM_MT_operator_presets(bpy.types.Menu): def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() diff --git a/release/scripts/op/screen_play_rendered_anim.py b/release/scripts/op/screen_play_rendered_anim.py index 244c3d4b332..579af9b34b3 100644 --- a/release/scripts/op/screen_play_rendered_anim.py +++ b/release/scripts/op/screen_play_rendered_anim.py @@ -147,11 +147,11 @@ class PlayRenderedAnim(bpy.types.Operator): def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() diff --git a/release/scripts/op/sequencer.py b/release/scripts/op/sequencer.py index e34489b335d..de341bef269 100644 --- a/release/scripts/op/sequencer.py +++ b/release/scripts/op/sequencer.py @@ -135,11 +135,11 @@ class SequencerDeinterlaceSelectedMovies(bpy.types.Operator): def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py index 1b6c036b2d2..83282924b5b 100644 --- a/release/scripts/op/uv.py +++ b/release/scripts/op/uv.py @@ -369,10 +369,12 @@ def menu_func(self, context): def register(): + bpy.utils.register_module(__name__) bpy.types.IMAGE_MT_uvs.append(menu_func) def unregister(): + bpy.utils.unregister_module(__name__) bpy.types.IMAGE_MT_uvs.remove(menu_func) if __name__ == "__main__": diff --git a/release/scripts/op/uvcalc_follow_active.py b/release/scripts/op/uvcalc_follow_active.py index a226e234f3a..12895fae1c5 100644 --- a/release/scripts/op/uvcalc_follow_active.py +++ b/release/scripts/op/uvcalc_follow_active.py @@ -251,11 +251,14 @@ menu_func = (lambda self, context: self.layout.operator(FollowActiveQuads.bl_idn def register(): + bpy.utils.register_module(__name__) bpy.types.VIEW3D_MT_uv_map.append(menu_func) def unregister(): + bpy.utils.unregister_module(__name__) bpy.types.VIEW3D_MT_uv_map.remove(menu_func) + if __name__ == "__main__": register() diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py index aaa8583b70f..8cdf593f98d 100644 --- a/release/scripts/op/uvcalc_smart_project.py +++ b/release/scripts/op/uvcalc_smart_project.py @@ -1130,10 +1130,12 @@ menu_func = (lambda self, context: self.layout.operator(SmartProject.bl_idname, def register(): + bpy.utils.register_module(__name__) bpy.types.VIEW3D_MT_uv_map.append(menu_func) def unregister(): + bpy.utils.unregister_module(__name__) bpy.types.VIEW3D_MT_uv_map.remove(menu_func) if __name__ == "__main__": diff --git a/release/scripts/op/vertexpaint_dirt.py b/release/scripts/op/vertexpaint_dirt.py index c5bb4450497..5102c94af69 100644 --- a/release/scripts/op/vertexpaint_dirt.py +++ b/release/scripts/op/vertexpaint_dirt.py @@ -180,11 +180,11 @@ class VertexPaintDirt(bpy.types.Operator): def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index 38fead4ecf8..cbc9e3cd55f 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -816,11 +816,11 @@ class WM_OT_sysinfo(bpy.types.Operator): def register(): - pass + bpy.utils.register_module(__name__) def unregister(): - pass + bpy.utils.unregister_module(__name__) if __name__ == "__main__": register() |