diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-09 14:01:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-09 14:01:44 +0300 |
commit | 94a8435124ef62a25d14818f7a8f29a8a2775c6c (patch) | |
tree | f9cd0b1e4198f593b5f2681093cb6b02ddbeffaa /release/scripts | |
parent | 897c2ede1345401f03d6af10fb361554cb07e19d (diff) |
make python UV functions use a popup UI rather then redo UI, they are not fast enough.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/op/uvcalc_follow_active.py | 9 | ||||
-rw-r--r-- | release/scripts/op/uvcalc_lightmap.py | 6 | ||||
-rw-r--r-- | 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(): |