Page MenuHome

Problems removing texture packing (without writing anything) using image.unpack() or bpy.ops.image.unpack()
Closed, ResolvedPublic


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: rB892c3891ed0b

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.

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['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.

Event Timeline

MACHIN3 (MACHIN3) updated the task description. (Show Details)
MACHIN3 (MACHIN3) updated the task description. (Show Details)
MACHIN3 (MACHIN3) updated the task description. (Show Details)

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.

Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to Low.Oct 29 2019, 11:36 AM

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...