diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-09-08 20:15:42 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-09-08 20:15:42 +0400 |
commit | d9ffc99e66d659ac887d801b9cc071b4c3f9b8ab (patch) | |
tree | d88e83b5a9edab115081641d26c811b6aa22296a /release/scripts/startup/bl_ui/space_image.py | |
parent | 551ebaa3dd758bc1975548c28766bfa3159d3846 (diff) | |
parent | b1490e39dd1017e51984d8a34d226e869bbb25df (diff) |
Merge branch 'master' into soc-2014-viewport_fxsoc-2014-viewport_fx
I have resolved some differences, for instance selection code which was more or less a stub, to be
the same as master. This will have to be fixed later.
Conflicts:
CMakeLists.txt
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_Window.cpp
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowX11.cpp
source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/intern/math_matrix.c
source/blender/gpu/CMakeLists.txt
source/blender/gpu/GPU_select.h
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_select.c
source/blender/gpu/shaders/gpu_shader_simple_vert.glsl
source/blender/nodes/CMakeLists.txt
Diffstat (limited to 'release/scripts/startup/bl_ui/space_image.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 134 |
1 files changed, 86 insertions, 48 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 97c89df0693..8fd0ded17f7 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -22,6 +22,7 @@ from bpy.types import Header, Menu, Panel from bl_ui.properties_paint_common import ( UnifiedPaintPanel, brush_texture_settings, + brush_texpaint_common, brush_mask_texture_settings, ) from bl_ui.properties_grease_pencil_common import GreasePencilPanel @@ -31,13 +32,11 @@ from bpy.app.translations import pgettext_iface as iface_ class ImagePaintPanel(UnifiedPaintPanel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' - bl_category = "Tools" -class BrushButtonsPanel: +class BrushButtonsPanel(UnifiedPaintPanel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' - bl_category = "Tools" @classmethod def poll(cls, context): @@ -66,6 +65,7 @@ class IMAGE_MT_view(Menu): sima = context.space_data uv = sima.uv_editor toolsettings = context.tool_settings + paint = toolsettings.image_paint show_uvedit = sima.show_uvedit show_render = sima.show_render @@ -80,6 +80,8 @@ class IMAGE_MT_view(Menu): layout.prop(toolsettings, "show_uv_local_view") layout.prop(uv, "show_other_objects") + if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'): + layout.prop(uv, "show_texpaint") layout.separator() @@ -140,6 +142,24 @@ class IMAGE_MT_select(Menu): layout.operator("uv.select_split") +class IMAGE_MT_brush(Menu): + bl_label = "Brush" + + def draw(self, context): + layout = self.layout + toolsettings = context.tool_settings + settings = toolsettings.image_paint + brush = settings.brush + + ups = context.tool_settings.unified_paint_settings + layout.prop(ups, "use_unified_size", text="Unified Size") + layout.prop(ups, "use_unified_strength", text="Unified Strength") + layout.separator() + + # brush tool + layout.prop_menu_enum(brush, "image_tool") + + class IMAGE_MT_image(Menu): bl_label = "Image" @@ -156,6 +176,8 @@ class IMAGE_MT_image(Menu): layout.operator("image.read_renderlayers") + layout.operator("image.save_dirty", text="Save All Images") + if ima: if not show_render: layout.operator("image.replace") @@ -382,7 +404,6 @@ class IMAGE_HT_header(Header): mode = sima.mode show_render = sima.show_render - # show_paint = sima.show_paint show_uvedit = sima.show_uvedit show_maskedit = sima.show_maskedit @@ -401,8 +422,7 @@ class IMAGE_HT_header(Header): row = layout.row() row.template_ID(sima, "mask", new="mask.new") - if show_uvedit or show_maskedit: - layout.prop(sima, "pivot_point", icon_only=True) + layout.prop(sima, "pivot_point", icon_only=True) # uv editing if show_uvedit: @@ -462,6 +482,7 @@ class MASK_MT_editor_menus(Menu): show_uvedit = sima.show_uvedit show_maskedit = sima.show_maskedit + show_paint = sima.show_paint layout.menu("IMAGE_MT_view") @@ -469,6 +490,8 @@ class MASK_MT_editor_menus(Menu): layout.menu("IMAGE_MT_select") if show_maskedit: layout.menu("MASK_MT_select") + if show_paint: + layout.menu("IMAGE_MT_brush") if ima and ima.is_dirty: layout.menu("IMAGE_MT_image", text="Image*") @@ -658,49 +681,27 @@ class IMAGE_PT_tools_transform_uvs(Panel, UVToolsPanel): col.operator("transform.shear") -class IMAGE_PT_paint(Panel, ImagePaintPanel): +class IMAGE_PT_paint(Panel, BrushButtonsPanel): bl_label = "Paint" - - @classmethod - def poll(cls, context): - sima = context.space_data - return sima.show_paint + bl_category = "Tools" def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint - brush = toolsettings.brush + settings = context.tool_settings.image_paint + brush = settings.brush col = layout.column() - col.template_ID_preview(toolsettings, "brush", new="brush.add", rows=2, cols=6) + col.template_ID_preview(settings, "brush", new="brush.add", rows=2, cols=6) if brush: - col = layout.column() - - if brush.image_tool == 'DRAW' and brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA'): - col.template_color_picker(brush, "color", value_slider=True) - col.prop(brush, "color", text="") - - row = col.row(align=True) - self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius") - self.prop_unified_size(row, context, brush, "use_pressure_size") - - row = col.row(align=True) - self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength") - self.prop_unified_strength(row, context, brush, "use_pressure_strength") - - col.prop(brush, "blend", text="Blend") - - if brush.image_tool == 'CLONE': - col.separator() - col.prop(brush, "clone_image", text="Image") - col.prop(brush, "clone_alpha", text="Alpha") + brush_texpaint_common(self, context, layout, brush, settings) class IMAGE_PT_tools_brush_overlay(BrushButtonsPanel, Panel): bl_label = "Overlay" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Options" def draw(self, context): layout = self.layout @@ -754,6 +755,7 @@ class IMAGE_PT_tools_brush_overlay(BrushButtonsPanel, Panel): class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): bl_label = "Texture" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Tools" def draw(self, context): layout = self.layout @@ -770,6 +772,7 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel): bl_label = "Texture Mask" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Tools" def draw(self, context): layout = self.layout @@ -786,6 +789,7 @@ class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel): class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel): bl_label = "Tool" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Options" def draw(self, context): layout = self.layout @@ -804,6 +808,7 @@ class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel): class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): bl_label = "Paint Stroke" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Tools" def draw(self, context): layout = self.layout @@ -828,10 +833,19 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): if brush.use_space: col.separator() row = col.row(align=True) - row.active = brush.use_space row.prop(brush, "spacing", text="Spacing") row.prop(brush, "use_pressure_spacing", toggle=True, text="") + if brush.use_line or brush.use_curve: + col.separator() + row = col.row(align=True) + row.prop(brush, "spacing", text="Spacing") + + if brush.use_curve: + col.separator() + col.template_ID(brush, "paint_curve", new="paintcurve.new") + col.operator("paintcurve.draw") + col = layout.column() col.separator() @@ -846,25 +860,23 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): col = layout.column() col.separator() - col.prop(brush, "use_smooth_stroke") + if brush.brush_capabilities.has_smooth_stroke: + col.prop(brush, "use_smooth_stroke") - sub = col.column() - sub.active = brush.use_smooth_stroke - sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) - sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) + sub = col.column() + sub.active = brush.use_smooth_stroke + sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) + sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) - col.separator() + col.separator() col.prop(toolsettings, "input_samples") - col.separator() - - col.prop(brush, "use_wrap") - class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): bl_label = "Paint Curve" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Tools" def draw(self, context): layout = self.layout @@ -874,7 +886,8 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): layout.template_curve_mapping(brush, "curve") - row = layout.row(align=True) + col = layout.column(align=True) + row = col.row(align=True) row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH' row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND' row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT' @@ -886,6 +899,7 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): class IMAGE_PT_tools_brush_appearance(BrushButtonsPanel, Panel): bl_label = "Appearance" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Options" def draw(self, context): layout = self.layout @@ -912,6 +926,30 @@ class IMAGE_PT_tools_brush_appearance(BrushButtonsPanel, Panel): sub.prop(brush, "icon_filepath", text="") +class IMAGE_PT_tools_paint_options(BrushButtonsPanel, Panel): + bl_label = "Image Paint" + bl_category = "Options" + + def draw(self, context): + layout = self.layout + + toolsettings = context.tool_settings + brush = toolsettings.image_paint.brush + + ups = toolsettings.unified_paint_settings + + col = layout.column(align=True) + + col.prop(brush, "use_wrap") + col.separator() + + col.label(text="Unified Settings:") + row = col.row() + row.prop(ups, "use_unified_size", text="Size") + row.prop(ups, "use_unified_strength", text="Strength") + col.prop(ups, "use_unified_color", text="Color") + + class IMAGE_UV_sculpt_curve(Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' @@ -1032,7 +1070,7 @@ class IMAGE_PT_view_waveform(Panel): layout.template_waveform(sima, "scopes") row = layout.split(percentage=0.75) row.prop(sima.scopes, "waveform_alpha") - row.prop(sima.scopes, "waveform_mode", icon_only=True) + row.prop(sima.scopes, "waveform_mode", text="") class IMAGE_PT_view_vectorscope(Panel): |