From 94a8435124ef62a25d14818f7a8f29a8a2775c6c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 9 Mar 2011 11:01:44 +0000 Subject: [PATCH] make python UV functions use a popup UI rather then redo UI, they are not fast enough. --- release/scripts/op/uvcalc_follow_active.py | 9 +++++++-- release/scripts/op/uvcalc_lightmap.py | 6 +++++- release/scripts/op/uvcalc_smart_project.py | 10 +++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/release/scripts/op/uvcalc_follow_active.py b/release/scripts/op/uvcalc_follow_active.py index 12895fae1c5..1b7a9292d03 100644 --- a/release/scripts/op/uvcalc_follow_active.py +++ b/release/scripts/op/uvcalc_follow_active.py @@ -245,9 +245,14 @@ class FollowActiveQuads(bpy.types.Operator): main(context, self) return {'FINISHED'} + def invoke(self, context, event): + wm = context.window_manager + return wm.invoke_props_dialog(self) -# Add to a menu -menu_func = (lambda self, context: self.layout.operator(FollowActiveQuads.bl_idname)) + +def menu_func(self, context): + self.layout.operator_context = 'INVOKE_REGION_WIN' + self.layout.operator(FollowActiveQuads.bl_idname) def register(): diff --git a/release/scripts/op/uvcalc_lightmap.py b/release/scripts/op/uvcalc_lightmap.py index fabdfa501a3..e514ddc1732 100644 --- a/release/scripts/op/uvcalc_lightmap.py +++ b/release/scripts/op/uvcalc_lightmap.py @@ -592,9 +592,13 @@ class LightMapPack(bpy.types.Operator): return unwrap(self, context, **kwargs) + def invoke(self, context, event): + wm = context.window_manager + return wm.invoke_props_dialog(self) + -# Add to a menu def menu_func(self, context): + self.layout.operator_context = 'INVOKE_REGION_WIN' self.layout.operator(LightMapPack.bl_idname) diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py index 4408b2d3755..241442d562a 100644 --- a/release/scripts/op/uvcalc_smart_project.py +++ b/release/scripts/op/uvcalc_smart_project.py @@ -1140,10 +1140,14 @@ class SmartProject(bpy.types.Operator): main(context, self.island_margin, self.angle_limit) return {'FINISHED'} + def invoke(self, context, event): + wm = context.window_manager + return wm.invoke_props_dialog(self) -# Add to a menu -menu_func = (lambda self, context: self.layout.operator(SmartProject.bl_idname, - text="Smart Project")) + +def menu_func(self, context): + self.layout.operator_context = 'INVOKE_REGION_WIN' + self.layout.operator(SmartProject.bl_idname, text="Smart Project") def register():