diff --git a/image_ops.py b/image_ops.py index 07ad91e2..6b79e6a5 100644 --- a/image_ops.py +++ b/image_ops.py @@ -865,9 +865,6 @@ class YSaveAsImage(bpy.types.Operator, ExportHelper): use_cineon_log : BoolProperty(name='Log', default=False) use_zbuffer : BoolProperty(name='Log', default=False) - # Option to unpack image if image is packed - unpack : BoolProperty(default=False) - # Flag for float image is_float : BoolProperty(default=False) @@ -1059,7 +1056,7 @@ def execute(self, context): # Unpack image if image is packed (Only necessary for Blender 2.80 and lower) # Packing and unpacking sometimes does not work if the blend file is not saved yet unpacked_to_disk = False - if not is_bl_newer_than(2, 81) and bpy.data.filepath != '' and (self.unpack or image.packed_file): + if not is_bl_newer_than(2, 81) and bpy.data.filepath != '' and image.packed_file: unpacked_to_disk = True self.unpack_image(context) @@ -1121,7 +1118,7 @@ def execute(self, context): self.remove_unpacked_image(context) # Remove packed flag - if is_bl_newer_than(2, 81) and self.unpack and image.packed_file: + if is_bl_newer_than(2, 81) and image.packed_file: image.unpack(method='REMOVE') # Set back colorspace settings diff --git a/ui.py b/ui.py index 24a907d2..598c0cb8 100644 --- a/ui.py +++ b/ui.py @@ -4407,13 +4407,8 @@ def draw(self, context): if context.image: if context.image.packed_file: - op = col.operator('node.y_save_as_image', text='Unpack As Image', icon='UGLYPACKAGE') - op.unpack = True - op.copy = False - else: - op = col.operator('node.y_save_as_image', text='Save As Image') - op.unpack = False - op.copy = False + col.operator('node.y_save_as_image', text='Unpack As Image', icon='UGLYPACKAGE').copy = False + else: col.operator('node.y_save_as_image', text='Save As Image').copy = False col.operator('node.y_save_as_image', text='Save an Image Copy...', icon='FILE_TICK').copy = True class YNewChannelMenu(bpy.types.Menu): @@ -4667,13 +4662,8 @@ def draw(self, context): col.operator('node.y_save_image', icon='FILE_TICK') if context.image.packed_file: - op = col.operator('node.y_save_as_image', text='Unpack As Image', icon='UGLYPACKAGE') - op.unpack = True - op.copy = False - else: - op = col.operator('node.y_save_as_image', text='Save As Image') - op.unpack = False - op.copy = False + col.operator('node.y_save_as_image', text='Unpack As Image', icon='UGLYPACKAGE').copy = False + else: col.operator('node.y_save_as_image', text='Save As Image').copy = False col.operator('node.y_save_as_image', text='Save an Image Copy...', icon='FILE_TICK').copy = True col.separator() @@ -4751,18 +4741,11 @@ def draw(self, context): col.operator('node.y_pack_image', icon='PACKAGE') col.operator('node.y_save_image', icon='FILE_TICK') if hasattr(context, 'image') and context.image.packed_file: - op = col.operator('node.y_save_as_image', text='Unpack As Image...', icon='UGLYPACKAGE') - op.unpack = True - op.copy = False + col.operator('node.y_save_as_image', text='Unpack As Image...', icon='UGLYPACKAGE').copy = False else: if is_bl_newer_than(2, 80): - op = col.operator('node.y_save_as_image', text='Save As Image...') - op.unpack = False - op.copy = False - else: - op = col.operator('node.y_save_as_image', text='Save As Image...', icon='SAVE_AS') - op.unpack = False - op.copy = False + col.operator('node.y_save_as_image', text='Save As Image...').copy = False + else: col.operator('node.y_save_as_image', text='Save As Image...', icon='SAVE_AS').copy = False col.operator('node.y_save_as_image', text='Save an Image Copy...', icon='FILE_TICK').copy = True col.separator()