Fix for [#25664] Remove Pack does not work in Texture panel
authorJanne Karhu <jhkarh@gmail.com>
Sat, 22 Jan 2011 14:44:04 +0000 (14:44 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Sat, 22 Jan 2011 14:44:04 +0000 (14:44 +0000)
* Unpack menu option "Remove Pack" didn't get a pointer to the image to be unpacked. This worked from image view by using the active image, but not from texture panel.

source/blender/editors/space_image/image_ops.c

index 3f4c10c8155ea4b86d874cd44541d049abef9ee6..cd54a899f35bfed184f1265ee656fb2d8f89625c 100644 (file)
@@ -1445,7 +1445,10 @@ static void unpack_menu(bContext *C, const char *opname, Image *ima, const char
        pup= uiPupMenuBegin(C, "Unpack file", ICON_NULL);
        layout= uiPupMenuLayout(pup);
 
-       uiItemEnumO(layout, opname, "Remove Pack", 0, "method", PF_REMOVE);
+       sprintf(line, "Remove Pack");
+       props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+       RNA_enum_set(&props_ptr, "method", PF_REMOVE);
+       RNA_string_set(&props_ptr, "image", ima->id.name+2);
 
        if(strcmp(abs_name, local_name)) {
                switch(checkPackedFile(local_name, pf)) {