diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-12 16:21:23 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 11:30:09 +0300 |
commit | 7f219137cf13003143f5d671b6c59bc500b53f75 (patch) | |
tree | 60282a1400a70d07e178e6650180667020468cc7 /release | |
parent | d1246969ed59ac36ffa332c283fb9d89f365a2b4 (diff) |
Disable scope updates in texture and image paint modes.
Scope update is very slow for high resolutions, and currently blocks
the UI thread(!). This is especially terrible in paint modes, where
each stroke causes a scope update and unacceptable freezing.
The scopes update method tries to avoid this somewhat by skipping if the
toolbar is disabled, but this doesn't help when painting where brush
tools etc. are frequently needed. It's also a bad-level poll, with the
core system accessing a UI element.
Eventually scope updates should become a low-priority background job,
as well as becoming threaded. Until then this polling provides a usable
workaround to the most outrageous cases.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index a1da262d9f2..a302dab28c3 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -1041,18 +1041,26 @@ class IMAGE_PT_tools_mask(MASK_PT_tools, Panel): # --- end mask --- - -class IMAGE_PT_view_histogram(Panel): +class ImageScopesPanel(): + @classmethod + def poll(cls, context): + sima = context.space_data + if not (sima and sima.image): + return False + # scopes are not updated in paint modes, hide + if sima.mode in {'PAINT'}: + return False + ob = context.active_object + if ob and ob.mode in {'TEXTURE_PAINT'}: + return False + return True + +class IMAGE_PT_view_histogram(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Histogram" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return (sima and sima.image) - def draw(self, context): layout = self.layout @@ -1065,17 +1073,12 @@ class IMAGE_PT_view_histogram(Panel): row.prop(hist, "show_line", text="") -class IMAGE_PT_view_waveform(Panel): +class IMAGE_PT_view_waveform(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Waveform" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return (sima and sima.image) - def draw(self, context): layout = self.layout @@ -1087,17 +1090,12 @@ class IMAGE_PT_view_waveform(Panel): row.prop(sima.scopes, "waveform_mode", text="") -class IMAGE_PT_view_vectorscope(Panel): +class IMAGE_PT_view_vectorscope(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Vectorscope" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return (sima and sima.image) - def draw(self, context): layout = self.layout @@ -1106,17 +1104,12 @@ class IMAGE_PT_view_vectorscope(Panel): layout.prop(sima.scopes, "vectorscope_alpha") -class IMAGE_PT_sample_line(Panel): +class IMAGE_PT_sample_line(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Sample Line" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return (sima and sima.image) - def draw(self, context): layout = self.layout @@ -1130,17 +1123,12 @@ class IMAGE_PT_sample_line(Panel): row.prop(hist, "show_line", text="") -class IMAGE_PT_scope_sample(Panel): +class IMAGE_PT_scope_sample(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Scope Samples" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return sima - def draw(self, context): layout = self.layout |