diff options
Diffstat (limited to 'release/ui/space_image.py')
-rw-r--r-- | release/ui/space_image.py | 121 |
1 files changed, 58 insertions, 63 deletions
diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 3f82727da47..090067120b1 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -2,19 +2,18 @@ import bpy class IMAGE_MT_view(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "View" def draw(self, context): layout = self.layout - sima = context.space_data uv = sima.uv_editor settings = context.tool_settings show_uvedit = sima.show_uvedit - layout.itemO("image.properties", icon='ICON_MENU_PANEL') + layout.itemO("image.properties", icon="ICON_MENU_PANEL") layout.itemS() @@ -44,7 +43,7 @@ class IMAGE_MT_view(bpy.types.Menu): layout.itemO("screen.screen_full_area") class IMAGE_MT_select(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Select" def draw(self, context): @@ -65,12 +64,11 @@ class IMAGE_MT_select(bpy.types.Menu): layout.itemO("uv.select_linked") class IMAGE_MT_image(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Image" def draw(self, context): layout = self.layout - sima = context.space_data ima = sima.image @@ -87,7 +85,7 @@ class IMAGE_MT_image(bpy.types.Menu): layout.itemO("image.save") layout.itemO("image.save_as") - if ima.source == 'SEQUENCE': + if ima.source == "SEQUENCE": layout.itemO("image.save_sequence") if not show_render: @@ -101,7 +99,7 @@ class IMAGE_MT_image(bpy.types.Menu): # only for dirty && specific image types, perhaps # this could be done in operator poll too if ima.dirty: - if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER': + if ima.source in ("FILE", "GENERATED") and ima.type != "MULTILAYER": layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG") layout.itemS() @@ -109,7 +107,7 @@ class IMAGE_MT_image(bpy.types.Menu): layout.itemR(sima, "image_painting") class IMAGE_MT_uvs_showhide(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Show/Hide Faces" def draw(self, context): @@ -120,7 +118,7 @@ class IMAGE_MT_uvs_showhide(bpy.types.Menu): layout.item_booleanO("uv.hide", "unselected", True) class IMAGE_MT_uvs_transform(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Transform" def draw(self, context): @@ -131,7 +129,7 @@ class IMAGE_MT_uvs_transform(bpy.types.Menu): layout.item_enumO("tfm.transform", "mode", 'RESIZE') class IMAGE_MT_uvs_mirror(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Mirror" def draw(self, context): @@ -141,7 +139,7 @@ class IMAGE_MT_uvs_mirror(bpy.types.Menu): layout.item_enumO("uv.mirror", "axis", 'MIRROR_Y') # "Y Axis", M, class IMAGE_MT_uvs_weldalign(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "Weld/Align" def draw(self, context): @@ -150,13 +148,13 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu): layout.itemO("uv.weld") # W, 1 layout.items_enumO("uv.align", "axis") # W, 2/3/4 + class IMAGE_MT_uvs(bpy.types.Menu): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" __label__ = "UVs" def draw(self, context): layout = self.layout - sima = context.space_data uv = sima.uv_editor settings = context.tool_settings @@ -194,14 +192,13 @@ class IMAGE_MT_uvs(bpy.types.Menu): layout.itemM("IMAGE_MT_uvs_showhide") class IMAGE_HT_header(bpy.types.Header): - __space_type__ = 'IMAGE_EDITOR' + __space_type__ = "IMAGE_EDITOR" def draw(self, context): - layout = self.layout - sima = context.space_data ima = sima.image iuser = sima.image_user + layout = self.layout settings = context.tool_settings show_render = sima.show_render @@ -250,7 +247,7 @@ class IMAGE_HT_header(bpy.types.Header): """ mesh = context.edit_object.data - row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures") + row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_layers") """ if ima: @@ -265,17 +262,17 @@ class IMAGE_HT_header(bpy.types.Header): row.itemR(sima, "draw_channels", text="", expand=True) row = layout.row(align=True) - if ima.type == 'COMPOSITE': - row.itemO("image.record_composite", icon='ICON_REC') - if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'): - row.itemO("image.play_composite", icon='ICON_PLAY') + if ima.type == "COMPOSITE": + row.itemO("image.record_composite", icon="ICON_REC") + if ima.type == "COMPOSITE" and ima.source in ("MOVIE", "SEQUENCE"): + row.itemO("image.play_composite", icon="ICON_PLAY") if show_uvedit or sima.image_painting: layout.itemR(sima, "update_automatically", text="") class IMAGE_PT_game_properties(bpy.types.Panel): - __space_type__ = 'IMAGE_EDITOR' - __region_type__ = 'UI' + __space_type__ = "IMAGE_EDITOR" + __region_type__ = "UI" __label__ = "Game Properties" def poll(self, context): @@ -284,48 +281,52 @@ class IMAGE_PT_game_properties(bpy.types.Panel): return (sima and sima.image) and (rd.engine == 'BLENDER_GAME') def draw(self, context): - layout = self.layout - sima = context.space_data + layout = self.layout + ima = sima.image - split = layout.split() + if ima: + split = layout.split() - col = split.column() - col.itemR(ima, "clamp_x") - col.itemR(ima, "clamp_y") - col.itemR(ima, "mapping", expand=True) - col.itemR(ima, "tiles") + col = split.column() - col = split.column() + subcol = col.column(align=True) + subcol.itemR(ima, "clamp_x") + subcol.itemR(ima, "clamp_y") + + col.itemR(ima, "mapping", expand=True) + col.itemR(ima, "tiles") + + col = split.column() - sub = col.column(align=True) - sub.itemR(ima, "animated") + subcol = col.column(align=True) + subcol.itemR(ima, "animated") - subsub = sub.column() - subsub.active = ima.animated - subsub.itemR(ima, "animation_start", text="Start") - subsub.itemR(ima, "animation_end", text="End") - subsub.itemR(ima, "animation_speed", text="Speed") + subcol = subcol.column() + subcol.itemR(ima, "animation_start", text="Start") + subcol.itemR(ima, "animation_end", text="End") + subcol.itemR(ima, "animation_speed", text="Speed") + subcol.active = ima.animated - sub = col.row(align=True) - sub.active = ima.tiles or ima.animated - sub.itemR(ima, "tiles_x", text="X") - sub.itemR(ima, "tiles_y", text="Y") + subrow = col.row(align=True) + subrow.itemR(ima, "tiles_x", text="X") + subrow.itemR(ima, "tiles_y", text="Y") + subrow.active = ima.tiles or ima.animated class IMAGE_PT_view_properties(bpy.types.Panel): - __space_type__ = 'IMAGE_EDITOR' - __region_type__ = 'UI' - __label__ = "Display" + __space_type__ = "IMAGE_EDITOR" + __region_type__ = "UI" + __label__ = "View Properties" def poll(self, context): sima = context.space_data return (sima and (sima.image or sima.show_uvedit)) def draw(self, context): - layout = self.layout - sima = context.space_data + layout = self.layout + ima = sima.image show_uvedit = sima.show_uvedit uvedit = sima.uv_editor @@ -334,33 +335,26 @@ class IMAGE_PT_view_properties(bpy.types.Panel): col = split.column() if ima: - col.itemR(ima, "display_aspect", text="Aspect Ratio") + col.itemR(ima, "display_aspect") col = split.column() - col.itemL(text="Coordinates:") col.itemR(sima, "draw_repeated", text="Repeat") if show_uvedit: col.itemR(uvedit, "normalized_coordinates", text="Normalized") elif show_uvedit: - col.itemL(text="Coordinates:") col.itemR(uvedit, "normalized_coordinates", text="Normalized") if show_uvedit: col = layout.column() row = col.row() row.itemR(uvedit, "edge_draw_type", expand=True) - - split = layout.split() + row = col.row() + row.itemR(uvedit, "draw_smooth_edges", text="Smooth") + row.itemR(uvedit, "draw_modified_edges", text="Modified") - col = split.column() - col.itemR(uvedit, "draw_stretch", text="Stretch") - sub = col.column() - sub.active = uvedit.draw_stretch - sub.row().itemR(uvedit, "draw_stretch_type", expand=True) - - col = split.column() - col.itemR(uvedit, "draw_smooth_edges", text="Smooth") - col.itemR(uvedit, "draw_modified_edges", text="Modified") + row = col.row() + row.itemR(uvedit, "draw_stretch", text="Stretch") + row.itemR(uvedit, "draw_stretch_type", text="") #col.itemR(uvedit, "draw_edges") #col.itemR(uvedit, "draw_faces") @@ -375,3 +369,4 @@ bpy.types.register(IMAGE_MT_uvs) bpy.types.register(IMAGE_HT_header) bpy.types.register(IMAGE_PT_game_properties) bpy.types.register(IMAGE_PT_view_properties) + |