diff options
Diffstat (limited to 'release/ui/space_image.py')
-rw-r--r-- | release/ui/space_image.py | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 63ca316efe7..49ef18705c4 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -96,9 +96,9 @@ class IMAGE_MT_image(bpy.types.Menu): else: layout.itemO("IMAGE_OT_pack") - # only for dirty && specific image types : XXX poll? - #if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) - if False: + # 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": layout.item_booleanO("IMAGE_OT_pack", "as_png", True, text="Pack As PNG") @@ -215,8 +215,10 @@ class IMAGE_HT_header(bpy.types.Header): if show_uvedit: row.itemM("IMAGE_MT_select") - # XXX menuname= (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))? "Image*": "Image"; - row.itemM("IMAGE_MT_image") + if ima and ima.dirty: + row.itemM("IMAGE_MT_image", text="Image*") + else: + row.itemM("IMAGE_MT_image", text="Image") if show_uvedit: row.itemM("IMAGE_MT_uvs") @@ -344,6 +346,10 @@ class IMAGE_PT_view_properties(bpy.types.Panel): __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): sima = context.space_data layout = self.layout @@ -358,10 +364,12 @@ class IMAGE_PT_view_properties(bpy.types.Panel): if ima: col.itemR(ima, "display_aspect") - col = split.column() - col.itemR(sima, "draw_repeated", text="Repeat") - if show_uvedit: - col.itemR(uvedit, "normalized_coordinates") + col = split.column() + col.itemR(sima, "draw_repeated", text="Repeat") + if show_uvedit: + col.itemR(uvedit, "normalized_coordinates", text="Normalized") + elif show_uvedit: + col.itemR(uvedit, "normalized_coordinates", text="Normalized") if show_uvedit: col = layout.column() @@ -377,21 +385,6 @@ class IMAGE_PT_view_properties(bpy.types.Panel): #col.itemR(uvedit, "draw_edges") #col.itemR(uvedit, "draw_faces") -class IMAGE_PT_curves(bpy.types.Panel): - __space_type__ = "IMAGE_EDITOR" - __region_type__ = "UI" - __label__ = "Curves" - - def poll(self, context): - sima = context.space_data - return (sima and sima.image) - - def draw(self, context): - sima = context.space_data - layout = self.layout - - layout.template_curve_mapping(sima.curves) - bpy.types.register(IMAGE_MT_view) bpy.types.register(IMAGE_MT_select) bpy.types.register(IMAGE_MT_image) @@ -403,5 +396,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) -#bpy.types.register(IMAGE_PT_curves) |