diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_image.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 167 |
1 files changed, 99 insertions, 68 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 9cbb27bcedb..1acc8cf601d 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy import math -from bpy.types import Header, Menu, Panel +from bpy.types import Header, Menu, Panel, UIList from .properties_paint_common import ( UnifiedPaintPanel, brush_texture_settings, @@ -126,9 +126,7 @@ class IMAGE_MT_view(Menu): layout.operator("image.cycle_render_slot", text="Render Slot Cycle Previous").reverse = True layout.separator() - layout.operator("screen.area_dupli") - layout.operator("screen.screen_full_area") - layout.operator("screen.screen_full_area", text="Toggle Fullscreen Area").use_hide_panels = True + layout.menu("INFO_MT_area") class IMAGE_MT_select(Menu): @@ -194,7 +192,7 @@ class IMAGE_MT_image(Menu): show_render = sima.show_render - layout.operator("image.read_renderlayers") + layout.operator("image.read_viewlayers") layout.operator("image.save_dirty", text="Save All Images") @@ -424,6 +422,43 @@ class IMAGE_MT_uvs_select_mode(Menu): props.data_path = "tool_settings.uv_select_mode" +class IMAGE_MT_specials(Menu): + bl_label = "UV Context Menu" + + def draw(self, context): + layout = self.layout + + sima = context.space_data + + # UV Edit Mode + if sima.show_uvedit: + layout.operator("uv.unwrap") + layout.operator("uv.follow_active_quads") + + layout.separator() + + layout.operator("uv.pin").clear = False + layout.operator("uv.pin", text="Unpin").clear = True + + layout.separator() + + layout.operator("uv.weld") + layout.operator("uv.stitch") + + layout.separator() + + layout.operator_enum("uv.align", "axis") # W, 2/3/4 + + layout.separator() + + layout.operator("transform.mirror", text="Mirror X").constraint_axis[0] = True + layout.operator("transform.mirror", text="Mirror Y").constraint_axis[1] = True + + layout.separator() + + layout.menu("IMAGE_MT_uvs_snap") + + class IMAGE_HT_header(Header): bl_space_type = 'IMAGE_EDITOR' @@ -443,20 +478,16 @@ class IMAGE_HT_header(Header): row = layout.row(align=True) row.template_header() - MASK_MT_editor_menus.draw_collapsible(context, layout) + layout.prop(sima, "mode", text="") layout.template_ID(sima, "image", new="image.new", open="image.open") if not show_render: layout.prop(sima, "use_image_pin", text="") - layout.prop(sima, "mode", text="") - if show_maskedit: row = layout.row() row.template_ID(sima, "mask", new="mask.new") - layout.prop(sima, "pivot_point", icon_only=True) - # uv editing if show_uvedit: uvedit = sima.uv_editor @@ -469,10 +500,25 @@ class IMAGE_HT_header(Header): layout.prop(toolsettings, "uv_select_mode", text="", expand=True) layout.prop(uvedit, "sticky_select_mode", icon_only=True) + MASK_MT_editor_menus.draw_collapsible(context, layout) + + layout.separator_spacer() + + if show_uvedit or show_maskedit or mode == 'PAINT': + layout.prop(sima, "use_realtime_update", icon_only=True, icon='LOCKED') + + if show_uvedit: + uvedit = sima.uv_editor + + mesh = context.edit_object.data + layout.prop_search(mesh.uv_layers, "active", mesh, "uv_layers", text="") + row = layout.row(align=True) row.prop(toolsettings, "proportional_edit", icon_only=True) - if toolsettings.proportional_edit != 'DISABLED': - row.prop(toolsettings, "proportional_edit_falloff", icon_only=True) + # if toolsettings.proportional_edit != 'DISABLED': + sub = row.row(align=True) + sub.active = toolsettings.proportional_edit != 'DISABLED' + sub.prop(toolsettings, "proportional_edit_falloff", icon_only=True) row = layout.row(align=True) row.prop(toolsettings, "use_snap", text="") @@ -480,8 +526,7 @@ class IMAGE_HT_header(Header): if toolsettings.snap_uv_element != 'INCREMENT': row.prop(toolsettings, "snap_target", text="") - mesh = context.edit_object.data - layout.prop_search(mesh.uv_textures, "active", mesh, "uv_textures", text="") + layout.prop(sima, "pivot_point", icon_only=True) if ima: if ima.is_stereo_3d: @@ -501,9 +546,6 @@ class IMAGE_HT_header(Header): if ima.type == 'COMPOSITE' and ima.source in {'MOVIE', 'SEQUENCE'}: row.operator("image.play_composite", icon='PLAY') - if show_uvedit or show_maskedit or mode == 'PAINT': - layout.prop(sima, "use_realtime_update", icon_only=True, icon='LOCKED') - class MASK_MT_editor_menus(Menu): bl_idname = "MASK_MT_editor_menus" @@ -615,50 +657,6 @@ class IMAGE_PT_image_properties(Panel): layout.template_image(sima, "image", iuser, multiview=True) -class IMAGE_PT_game_properties(Panel): - bl_space_type = 'IMAGE_EDITOR' - bl_region_type = 'UI' - bl_label = "Game Properties" - - @classmethod - def poll(cls, context): - sima = context.space_data - # display even when not in game mode because these settings effect the 3d view - return (sima and sima.image and not sima.show_maskedit) # and (rd.engine == 'BLENDER_GAME') - - def draw(self, context): - layout = self.layout - - sima = context.space_data - ima = sima.image - - split = layout.split() - col = split.column() - col.prop(ima, "use_animation") - sub = col.column(align=True) - sub.active = ima.use_animation - sub.prop(ima, "frame_start", text="Start") - sub.prop(ima, "frame_end", text="End") - sub.prop(ima, "fps", text="Speed") - - col = split.column() - col.prop(ima, "use_tiles") - sub = col.column(align=True) - sub.active = ima.use_tiles or ima.use_animation - sub.prop(ima, "tiles_x", text="X") - sub.prop(ima, "tiles_y", text="Y") - - split = layout.split() - col = split.column() - col.label(text="Clamp:") - col.prop(ima, "use_clamp_x", text="X") - col.prop(ima, "use_clamp_y", text="Y") - - col = split.column() - col.label(text="Mapping:") - col.prop(ima, "mapping", expand=True) - - class IMAGE_PT_view_properties(Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'UI' @@ -690,11 +688,11 @@ class IMAGE_PT_view_properties(Panel): col.label(text="Coordinates:") col.prop(sima, "show_repeat", text="Repeat") if show_uvedit: - col.prop(uvedit, "show_normalized_coords", text="Normalized") + col.prop(uvedit, "show_pixel_coords", text="Pixel") elif show_uvedit: col.label(text="Coordinates:") - col.prop(uvedit, "show_normalized_coords", text="Normalized") + col.prop(uvedit, "show_pixel_coords", text="Pixel") if show_uvedit or show_maskedit: col = layout.column() @@ -726,10 +724,41 @@ class IMAGE_PT_view_properties(Panel): row.active = uvedit.show_other_objects row.prop(uvedit, "other_uv_filter", text="Filter") - if show_render and ima: - layout.separator() - render_slot = ima.render_slots.active - layout.prop(render_slot, "name", text="Slot Name") + +class IMAGE_UL_render_slots(UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): + slot = item + layout.prop(slot, "name", text="", emboss=False) + + +class IMAGE_PT_render_slots(Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'UI' + bl_label = "Render Slots" + + @classmethod + def poll(cls, context): + sima = context.space_data + return (sima and sima.image and sima.show_render) + + def draw(self, context): + layout = self.layout + + sima = context.space_data + ima = sima.image + + row = layout.row() + + col = row.column() + col.template_list("IMAGE_UL_render_slots", "render_slots", ima, "render_slots", ima.render_slots, "active_index", rows=3) + + col = row.column(align=True) + col.operator("image.add_render_slot", icon='ZOOMIN', text="") + col.operator("image.remove_render_slot", icon='ZOOMOUT', text="") + + col.separator() + + col.operator("image.clear_render_slot", icon='X', text="") class IMAGE_PT_tools_transform_uvs(Panel, UVToolsPanel): @@ -1353,6 +1382,7 @@ classes = ( IMAGE_MT_uvs_mirror, IMAGE_MT_uvs_weldalign, IMAGE_MT_uvs_select_mode, + IMAGE_MT_specials, IMAGE_HT_header, MASK_MT_editor_menus, IMAGE_PT_mask, @@ -1362,7 +1392,8 @@ classes = ( IMAGE_PT_active_mask_spline, IMAGE_PT_active_mask_point, IMAGE_PT_image_properties, - IMAGE_PT_game_properties, + IMAGE_UL_render_slots, + IMAGE_PT_render_slots, IMAGE_PT_view_properties, IMAGE_PT_tools_transform_uvs, IMAGE_PT_tools_align_uvs, |