Problems removing texture packing (without writing anything) using image.unpack() or bpy.ops.image.unpack() #71171

Closed
opened 2019-10-28 21:40:15 +01:00 by MACHIN3 · 7 comments

System Information
Operating system: Linux-4.13.10-041310-generic-x86_64-with-debian-stretch-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.67

Blender Version
Broken: version: 2.81 (sub 15), branch: master, commit date: 2019-10-24 19:00, hash: blender/blender@892c3891ed

Short description of error

The bpy.ops.image.unpack() operator has the option to just remove packing (and I assume not writing anything), it's called 'Remove Pack' in the menu. See screenshot.

remove_pack.jpg

The python reference in the tooltip for this operator is bpy.ops.image.unpack(method='<UNKNOWN ENUM>', ... ).
Despite the faulty(?) method argument, it seams to work without an issue.

The unpack method on an image bpy.data.images['normal.png'].unpack(), which can do the same, only has the following items for the enum: {'USE_LOCAL', 'WRITE_LOCAL', 'USE_ORIGINAL', 'WRITE_ORIGINAL}

I'm wondering if there is one method missing, the one currently called 'Remove Pack/` in the operator.

**System Information** Operating system: Linux-4.13.10-041310-generic-x86_64-with-debian-stretch-sid 64 Bits Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.67 **Blender Version** Broken: version: 2.81 (sub 15), branch: master, commit date: 2019-10-24 19:00, hash: `blender/blender@892c3891ed` **Short description of error** The `bpy.ops.image.unpack()` operator has the option to just remove packing (and I assume not writing anything), it's called 'Remove Pack' in the menu. See screenshot. ![remove_pack.jpg](https://archive.blender.org/developer/F7866567/remove_pack.jpg) The python reference in the tooltip for this operator is `bpy.ops.image.unpack(method='<UNKNOWN ENUM>', ... )`. Despite the faulty(?) method argument, it seams to work without an issue. The unpack method on an image `bpy.data.images['normal.png'].unpack()`, which can do the same, only has the following items for the enum: `{'USE_LOCAL', 'WRITE_LOCAL', 'USE_ORIGINAL', 'WRITE_ORIGINAL}` I'm wondering if there is one method missing, the one currently called 'Remove Pack`/`<UNKNOWN ENUM>` in the operator.
Author

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3

Added subscriber: @Stan_Pancakes

Added subscriber: @Stan_Pancakes

PF_REMOVE (the '' here) is just not exposed to the Python API, and only set internally when generating that menu. Presumably because it's unsafe for work, i.e. if the file does not actually exist, data would be lost when .blend file is closed, unlike 'USE_ORIGINAL', that would actually write to file if it doesn't exist. Exposing it is trivial, but it'd be nice to see the devs' rationale on it.

PF_REMOVE (the '<UNKNOWN ENUM>' here) is just not exposed to the Python API, and only set internally when generating that menu. Presumably because it's unsafe for work, i.e. if the file does not actually exist, data would be lost when .blend file is closed, unlike 'USE_ORIGINAL', that would actually write to file if it doesn't exist. Exposing it is trivial, but it'd be nice to see the devs' rationale on it.

This issue was referenced by blender/blender@9efe12d77a

This issue was referenced by blender/blender@9efe12d77a60fab1215f09c6231337244df3c176
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Of course we could add these to unpack_all_method_items, rna_enum_unpack_method_items and I dont see a particular reason to not expose this (if we have this in the UI already), see D6152
Will confirm with low prio for now...

Of course we could add these to `unpack_all_method_items`, `rna_enum_unpack_method_items` and I dont see a particular reason to not expose this (if we have this in the UI already), see [D6152](https://archive.blender.org/developer/D6152) Will confirm with low prio for now...
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Philipp Oeser self-assigned this 2019-10-29 14:34:26 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#71171
No description provided.