2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2008 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup spinfo
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
#include <cstring>
|
2024-09-20 16:18:12 +02:00
|
|
|
#include <fmt/format.h>
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
|
#include "DNA_windowmanager_types.h"
|
|
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
2024-02-09 18:59:42 +01:00
|
|
|
#include "BLT_translation.hh"
|
2013-02-24 15:40:28 +00:00
|
|
|
|
2024-02-09 19:23:03 +01:00
|
|
|
#include "BKE_bpath.hh"
|
2023-11-16 11:41:55 +01:00
|
|
|
#include "BKE_context.hh"
|
2024-02-10 18:25:14 +01:00
|
|
|
#include "BKE_global.hh"
|
2024-11-12 15:21:59 +01:00
|
|
|
#include "BKE_image.hh"
|
2024-01-15 12:44:04 -05:00
|
|
|
#include "BKE_lib_id.hh"
|
2025-02-07 17:47:16 +01:00
|
|
|
#include "BKE_library.hh"
|
2023-12-01 19:43:16 +01:00
|
|
|
#include "BKE_main.hh"
|
2024-08-08 15:13:14 +02:00
|
|
|
#include "BKE_packedFile.hh"
|
2024-02-10 18:34:29 +01:00
|
|
|
#include "BKE_report.hh"
|
2023-09-25 17:48:21 -04:00
|
|
|
#include "BKE_screen.hh"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2023-08-04 23:11:22 +02:00
|
|
|
#include "WM_api.hh"
|
|
|
|
|
#include "WM_types.hh"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2023-08-05 02:57:52 +02:00
|
|
|
#include "UI_interface.hh"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2023-08-10 22:40:27 +02:00
|
|
|
#include "RNA_access.hh"
|
|
|
|
|
#include "RNA_define.hh"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
#include "info_intern.hh"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Pack Blend File Libraries Operator
|
|
|
|
|
* \{ */
|
2012-12-27 15:07:19 +00:00
|
|
|
|
|
|
|
|
static int pack_libraries_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
Main *bmain = CTX_data_main(C);
|
|
|
|
|
|
2019-07-07 23:57:35 +10:00
|
|
|
BKE_packedfile_pack_all_libraries(bmain, op->reports);
|
2012-12-27 15:07:19 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_pack_libraries(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->name = "Pack Linked Libraries";
|
2012-12-27 15:07:19 +00:00
|
|
|
ot->idname = "FILE_OT_pack_libraries";
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->description =
|
2021-05-05 12:11:39 +10:00
|
|
|
"Store all data-blocks linked from other .blend files in the current .blend file. "
|
|
|
|
|
"Library references are preserved so the linked data-blocks can be unpacked again";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-12-27 15:07:19 +00:00
|
|
|
/* api callbacks */
|
|
|
|
|
ot->exec = pack_libraries_exec;
|
|
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int unpack_libraries_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
Main *bmain = CTX_data_main(C);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2023-05-23 11:53:05 +10:00
|
|
|
WM_cursor_wait(true);
|
2019-07-07 23:57:35 +10:00
|
|
|
BKE_packedfile_unpack_all_libraries(bmain, op->reports);
|
2023-05-23 11:53:05 +10:00
|
|
|
WM_cursor_wait(false);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-12-27 15:07:19 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Unpack Blend File Libraries Operator
|
|
|
|
|
* \{ */
|
|
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
static int unpack_libraries_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
2012-12-27 15:07:19 +00:00
|
|
|
{
|
2024-02-23 02:02:55 +01:00
|
|
|
return WM_operator_confirm_ex(C,
|
|
|
|
|
op,
|
|
|
|
|
IFACE_("Restore Packed Linked Data to Their Original Locations"),
|
|
|
|
|
IFACE_("Will create directories so that all paths are valid."),
|
|
|
|
|
IFACE_("Unpack"),
|
|
|
|
|
ALERT_ICON_INFO,
|
|
|
|
|
false);
|
2012-12-27 15:07:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_unpack_libraries(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->name = "Unpack Linked Libraries";
|
2012-12-27 15:07:19 +00:00
|
|
|
ot->idname = "FILE_OT_unpack_libraries";
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->description = "Restore all packed linked data-blocks to their original locations";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-12-27 15:07:19 +00:00
|
|
|
/* api callbacks */
|
|
|
|
|
ot->invoke = unpack_libraries_invoke;
|
|
|
|
|
ot->exec = unpack_libraries_exec;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-12-27 15:07:19 +00:00
|
|
|
/* flags */
|
|
|
|
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Toggle Auto-Pack Operator
|
|
|
|
|
* \{ */
|
2013-12-23 18:35:32 +01:00
|
|
|
|
|
|
|
|
static int autopack_toggle_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
Main *bmain = CTX_data_main(C);
|
|
|
|
|
|
2019-02-02 13:39:51 +11:00
|
|
|
if (G.fileflags & G_FILE_AUTOPACK) {
|
|
|
|
|
G.fileflags &= ~G_FILE_AUTOPACK;
|
2013-12-23 18:35:32 +01:00
|
|
|
}
|
|
|
|
|
else {
|
2019-07-07 23:57:35 +10:00
|
|
|
BKE_packedfile_pack_all(bmain, op->reports, true);
|
2019-02-02 13:39:51 +11:00
|
|
|
G.fileflags |= G_FILE_AUTOPACK;
|
2013-12-23 18:35:32 +01:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2013-12-23 18:35:32 +01:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_autopack_toggle(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->name = "Automatically Pack Resources";
|
2013-12-23 18:35:32 +01:00
|
|
|
ot->idname = "FILE_OT_autopack_toggle";
|
|
|
|
|
ot->description = "Automatically pack all external files into the .blend file";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2013-12-23 18:35:32 +01:00
|
|
|
/* api callbacks */
|
|
|
|
|
ot->exec = autopack_toggle_exec;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2013-12-23 18:35:32 +01:00
|
|
|
/* flags */
|
|
|
|
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
|
|
|
|
}
|
2012-12-27 15:07:19 +00:00
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Pack All Operator
|
|
|
|
|
* \{ */
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
static int pack_all_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
Main *bmain = CTX_data_main(C);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-07-07 23:57:35 +10:00
|
|
|
BKE_packedfile_pack_all(bmain, op->reports, true);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2024-09-20 16:18:12 +02:00
|
|
|
WM_main_add_notifier(NC_WINDOW, nullptr);
|
|
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
static int pack_all_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
2009-06-30 19:20:45 +00:00
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
Main *bmain = CTX_data_main(C);
|
2009-06-30 19:20:45 +00:00
|
|
|
Image *ima;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* First check for dirty images. */
|
2023-06-09 09:44:08 +10:00
|
|
|
for (ima = static_cast<Image *>(bmain->images.first); ima;
|
|
|
|
|
ima = static_cast<Image *>(ima->id.next))
|
|
|
|
|
{
|
2019-05-14 17:28:13 +02:00
|
|
|
if (BKE_image_is_dirty(ima)) {
|
|
|
|
|
break;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ima) {
|
2024-02-24 01:42:20 +01:00
|
|
|
return WM_operator_confirm_ex(
|
|
|
|
|
C,
|
|
|
|
|
op,
|
|
|
|
|
IFACE_("Pack all used external files into this .blend file"),
|
|
|
|
|
IFACE_("Warning: Some images are modified and these changes will be lost."),
|
|
|
|
|
IFACE_("Pack"),
|
|
|
|
|
ALERT_ICON_WARNING,
|
|
|
|
|
false);
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
return pack_all_exec(C, op);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_pack_all(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->name = "Pack Resources";
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->idname = "FILE_OT_pack_all";
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->description = "Pack all used external files into this .blend";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = pack_all_exec;
|
|
|
|
|
ot->invoke = pack_all_invoke;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* flags */
|
2012-03-28 11:53:18 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Unpack All Operator
|
|
|
|
|
* \{ */
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
static const EnumPropertyItem unpack_all_method_items[] = {
|
|
|
|
|
{PF_USE_LOCAL, "USE_LOCAL", 0, "Use files in current directory (create when necessary)", ""},
|
|
|
|
|
{PF_WRITE_LOCAL,
|
|
|
|
|
"WRITE_LOCAL",
|
|
|
|
|
0,
|
|
|
|
|
"Write files to current directory (overwrite existing files)",
|
|
|
|
|
""},
|
|
|
|
|
{PF_USE_ORIGINAL,
|
|
|
|
|
"USE_ORIGINAL",
|
|
|
|
|
0,
|
|
|
|
|
"Use files in original location (create when necessary)",
|
|
|
|
|
""},
|
|
|
|
|
{PF_WRITE_ORIGINAL,
|
|
|
|
|
"WRITE_ORIGINAL",
|
|
|
|
|
0,
|
|
|
|
|
"Write files to original location (overwrite existing files)",
|
2019-04-17 06:17:24 +02:00
|
|
|
""},
|
2020-12-24 11:07:32 -06:00
|
|
|
{PF_KEEP, "KEEP", 0, "Disable auto-pack, keep all packed files", ""},
|
2019-10-29 11:33:41 +01:00
|
|
|
{PF_REMOVE, "REMOVE", 0, "Remove Pack", ""},
|
2012-01-17 16:22:22 +00:00
|
|
|
/* {PF_ASK, "ASK", 0, "Ask for each file", ""}, */
|
2023-06-09 09:44:08 +10:00
|
|
|
{0, nullptr, 0, nullptr, nullptr},
|
2019-02-03 14:01:45 +11:00
|
|
|
};
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
static int unpack_all_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
Main *bmain = CTX_data_main(C);
|
2023-06-09 09:44:08 +10:00
|
|
|
ePF_FileStatus method = ePF_FileStatus(RNA_enum_get(op->ptr, "method"));
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2019-03-26 21:16:47 +11:00
|
|
|
if (method != PF_KEEP) {
|
2023-05-23 11:53:05 +10:00
|
|
|
WM_cursor_wait(true);
|
2021-04-24 18:14:15 -06:00
|
|
|
BKE_packedfile_unpack_all(bmain, op->reports, method); /* XXX PF_ASK can't work here */
|
2023-05-23 11:53:05 +10:00
|
|
|
WM_cursor_wait(false);
|
2019-03-26 21:16:47 +11:00
|
|
|
}
|
2019-02-02 13:39:51 +11:00
|
|
|
G.fileflags &= ~G_FILE_AUTOPACK;
|
2024-09-20 16:18:12 +02:00
|
|
|
WM_main_add_notifier(NC_WINDOW, nullptr);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
static int unpack_all_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
2009-06-30 19:20:45 +00:00
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
Main *bmain = CTX_data_main(C);
|
2009-06-30 19:20:45 +00:00
|
|
|
uiPopupMenu *pup;
|
|
|
|
|
uiLayout *layout;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2024-09-20 16:18:12 +02:00
|
|
|
const PackedFileCount count = BKE_packedfile_count_all(bmain);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2024-09-20 16:18:12 +02:00
|
|
|
if (count.total() == 0) {
|
2013-12-23 18:35:32 +01:00
|
|
|
BKE_report(op->reports, RPT_WARNING, "No packed files to unpack");
|
2019-02-02 13:39:51 +11:00
|
|
|
G.fileflags &= ~G_FILE_AUTOPACK;
|
2009-06-30 19:20:45 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-20 16:18:12 +02:00
|
|
|
const std::string title = fmt::format(
|
2024-11-20 10:41:29 +01:00
|
|
|
fmt::runtime(IFACE_("Unpack - Files: {}, Bakes: {}")), count.individual_files, count.bakes);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2024-09-20 16:18:12 +02:00
|
|
|
pup = UI_popup_menu_begin(C, title.c_str(), ICON_NONE);
|
2014-11-09 21:20:40 +01:00
|
|
|
layout = UI_popup_menu_layout(pup);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
|
2020-09-15 08:10:23 -06:00
|
|
|
uiItemsEnumO(layout, "FILE_OT_unpack_all", "method");
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_popup_menu_end(C, pup);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2014-10-28 17:51:06 +01:00
|
|
|
return OPERATOR_INTERFACE;
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_unpack_all(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->name = "Unpack Resources";
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->idname = "FILE_OT_unpack_all";
|
2012-05-04 15:00:36 +00:00
|
|
|
ot->description = "Unpack all files packed into this .blend to external ones";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = unpack_all_exec;
|
|
|
|
|
ot->invoke = unpack_all_invoke;
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-28 11:53:18 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
/* properties */
|
2011-09-19 12:26:20 +00:00
|
|
|
RNA_def_enum(
|
|
|
|
|
ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack");
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Unpack Single Item Operator
|
|
|
|
|
* \{ */
|
2013-01-27 14:28:45 +00:00
|
|
|
|
|
|
|
|
static const EnumPropertyItem unpack_item_method_items[] = {
|
|
|
|
|
{PF_USE_LOCAL, "USE_LOCAL", 0, "Use file from current directory (create when necessary)", ""},
|
|
|
|
|
{PF_WRITE_LOCAL,
|
|
|
|
|
"WRITE_LOCAL",
|
|
|
|
|
0,
|
|
|
|
|
"Write file to current directory (overwrite existing file)",
|
|
|
|
|
""},
|
|
|
|
|
{PF_USE_ORIGINAL,
|
|
|
|
|
"USE_ORIGINAL",
|
|
|
|
|
0,
|
|
|
|
|
"Use file in original location (create when necessary)",
|
|
|
|
|
""},
|
|
|
|
|
{PF_WRITE_ORIGINAL,
|
|
|
|
|
"WRITE_ORIGINAL",
|
|
|
|
|
0,
|
|
|
|
|
"Write file to original location (overwrite existing file)",
|
2019-04-17 06:17:24 +02:00
|
|
|
""},
|
2013-01-27 14:28:45 +00:00
|
|
|
/* {PF_ASK, "ASK", 0, "Ask for each file", ""}, */
|
2023-06-09 09:44:08 +10:00
|
|
|
{0, nullptr, 0, nullptr, nullptr},
|
2019-02-03 14:01:45 +11:00
|
|
|
};
|
2013-01-27 14:28:45 +00:00
|
|
|
|
|
|
|
|
static int unpack_item_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
Main *bmain = CTX_data_main(C);
|
|
|
|
|
ID *id;
|
2013-02-06 02:48:03 +00:00
|
|
|
char idname[MAX_ID_NAME - 2];
|
2013-01-27 14:28:45 +00:00
|
|
|
int type = RNA_int_get(op->ptr, "id_type");
|
2023-06-09 09:44:08 +10:00
|
|
|
ePF_FileStatus method = ePF_FileStatus(RNA_enum_get(op->ptr, "method"));
|
2013-02-06 02:48:03 +00:00
|
|
|
|
2013-01-27 14:28:45 +00:00
|
|
|
RNA_string_get(op->ptr, "id_name", idname);
|
2018-05-31 16:04:04 +02:00
|
|
|
id = BKE_libblock_find_name(bmain, type, idname);
|
2013-01-27 14:28:45 +00:00
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
if (id == nullptr) {
|
2013-01-27 14:28:45 +00:00
|
|
|
BKE_report(op->reports, RPT_WARNING, "No packed file");
|
|
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2025-02-03 18:27:13 +01:00
|
|
|
if (!ID_IS_EDITABLE(id)) {
|
|
|
|
|
BKE_report(op->reports, RPT_WARNING, "Data-block using this packed file is not editable");
|
|
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-26 21:16:47 +11:00
|
|
|
if (method != PF_KEEP) {
|
2023-05-23 11:53:05 +10:00
|
|
|
WM_cursor_wait(true);
|
2021-04-24 18:14:15 -06:00
|
|
|
BKE_packedfile_id_unpack(bmain, id, op->reports, method); /* XXX PF_ASK can't work here */
|
2023-05-23 11:53:05 +10:00
|
|
|
WM_cursor_wait(false);
|
2019-03-26 21:16:47 +11:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2019-02-02 13:39:51 +11:00
|
|
|
G.fileflags &= ~G_FILE_AUTOPACK;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2013-01-27 14:28:45 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
static int unpack_item_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
2013-01-27 14:28:45 +00:00
|
|
|
{
|
|
|
|
|
uiPopupMenu *pup;
|
|
|
|
|
uiLayout *layout;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
pup = UI_popup_menu_begin(C, IFACE_("Unpack"), ICON_NONE);
|
|
|
|
|
layout = UI_popup_menu_layout(pup);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2013-01-27 14:28:45 +00:00
|
|
|
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
|
2023-06-09 09:44:08 +10:00
|
|
|
uiItemsFullEnumO(layout,
|
|
|
|
|
op->type->idname,
|
|
|
|
|
"method",
|
|
|
|
|
static_cast<IDProperty *>(op->ptr->data),
|
|
|
|
|
WM_OP_EXEC_REGION_WIN,
|
2023-07-29 15:06:33 +10:00
|
|
|
UI_ITEM_NONE);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2014-11-09 21:20:40 +01:00
|
|
|
UI_popup_menu_end(C, pup);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2014-10-28 17:51:06 +01:00
|
|
|
return OPERATOR_INTERFACE;
|
2013-01-27 14:28:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_unpack_item(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
|
|
|
|
ot->name = "Unpack Item";
|
|
|
|
|
ot->idname = "FILE_OT_unpack_item";
|
|
|
|
|
ot->description = "Unpack this file to an external file";
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-01-27 14:28:45 +00:00
|
|
|
/* api callbacks */
|
|
|
|
|
ot->exec = unpack_item_exec;
|
|
|
|
|
ot->invoke = unpack_item_invoke;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-01-27 14:28:45 +00:00
|
|
|
/* flags */
|
|
|
|
|
ot->flag = OPTYPE_UNDO;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-01-27 14:28:45 +00:00
|
|
|
/* properties */
|
|
|
|
|
RNA_def_enum(
|
|
|
|
|
ot->srna, "method", unpack_item_method_items, PF_USE_LOCAL, "Method", "How to unpack");
|
2014-01-16 21:43:22 +11:00
|
|
|
RNA_def_string(
|
2023-06-09 09:44:08 +10:00
|
|
|
ot->srna, "id_name", nullptr, BKE_ST_MAXNAME, "ID Name", "Name of ID block to unpack");
|
2013-02-06 02:48:03 +00:00
|
|
|
RNA_def_int(ot->srna,
|
|
|
|
|
"id_type",
|
|
|
|
|
ID_IM,
|
|
|
|
|
0,
|
|
|
|
|
INT_MAX,
|
|
|
|
|
"ID Type",
|
|
|
|
|
"Identifier type of ID block",
|
|
|
|
|
0,
|
|
|
|
|
INT_MAX);
|
2013-01-27 14:28:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Make Paths Relative Operator
|
|
|
|
|
* \{ */
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2010-12-06 00:52:30 +00:00
|
|
|
static int make_paths_relative_exec(bContext *C, wmOperator *op)
|
2009-06-30 19:20:45 +00:00
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
Main *bmain = CTX_data_main(C);
|
2021-12-16 11:38:10 +11:00
|
|
|
const char *blendfile_path = BKE_main_blendfile_path(bmain);
|
2010-12-06 00:52:30 +00:00
|
|
|
|
2021-12-16 11:38:10 +11:00
|
|
|
if (blendfile_path[0] == '\0') {
|
2012-10-26 17:32:50 +00:00
|
|
|
BKE_report(op->reports, RPT_WARNING, "Cannot set relative paths with an unsaved blend file");
|
2009-06-30 19:20:45 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-19 14:49:03 +10:00
|
|
|
BPathSummary summary;
|
|
|
|
|
BKE_bpath_relative_convert(bmain, blendfile_path, op->reports, &summary);
|
|
|
|
|
BKE_bpath_summary_report(summary, op->reports);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2010-12-05 23:14:48 +00:00
|
|
|
/* redraw everything so any changed paths register */
|
2023-06-09 09:44:08 +10:00
|
|
|
WM_main_add_notifier(NC_WINDOW, nullptr);
|
2010-12-05 23:14:48 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_make_paths_relative(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->name = "Make Paths Relative";
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->idname = "FILE_OT_make_paths_relative";
|
2012-05-04 15:00:36 +00:00
|
|
|
ot->description = "Make all paths to external files relative to current .blend";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = make_paths_relative_exec;
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-28 11:53:18 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Make Paths Absolute Operator
|
|
|
|
|
* \{ */
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2010-12-06 00:52:30 +00:00
|
|
|
static int make_paths_absolute_exec(bContext *C, wmOperator *op)
|
2009-06-30 19:20:45 +00:00
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
Main *bmain = CTX_data_main(C);
|
2021-12-16 11:38:10 +11:00
|
|
|
const char *blendfile_path = BKE_main_blendfile_path(bmain);
|
2010-12-06 00:52:30 +00:00
|
|
|
|
2021-12-16 11:38:10 +11:00
|
|
|
if (blendfile_path[0] == '\0') {
|
2012-10-26 17:32:50 +00:00
|
|
|
BKE_report(op->reports, RPT_WARNING, "Cannot set absolute paths with an unsaved blend file");
|
2009-06-30 19:20:45 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-19 14:49:03 +10:00
|
|
|
BPathSummary summary;
|
|
|
|
|
BKE_bpath_absolute_convert(bmain, blendfile_path, op->reports, &summary);
|
|
|
|
|
BKE_bpath_summary_report(summary, op->reports);
|
2010-12-05 23:14:48 +00:00
|
|
|
|
|
|
|
|
/* redraw everything so any changed paths register */
|
2023-06-09 09:44:08 +10:00
|
|
|
WM_main_add_notifier(NC_WINDOW, nullptr);
|
2010-12-05 23:14:48 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_make_paths_absolute(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2021-04-28 16:01:44 +02:00
|
|
|
ot->name = "Make Paths Absolute";
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->idname = "FILE_OT_make_paths_absolute";
|
2012-05-04 15:00:36 +00:00
|
|
|
ot->description = "Make all paths to external files absolute";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = make_paths_absolute_exec;
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-28 11:53:18 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Report Missing Files Operator
|
|
|
|
|
* \{ */
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2011-10-27 01:25:07 +00:00
|
|
|
static int report_missing_files_exec(bContext *C, wmOperator *op)
|
2009-06-30 19:20:45 +00:00
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
Main *bmain = CTX_data_main(C);
|
2011-10-27 01:25:07 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* run the missing file check */
|
2012-12-15 15:31:50 +00:00
|
|
|
BKE_bpath_missing_files_check(bmain, op->reports);
|
2024-04-24 19:54:44 +02:00
|
|
|
/* Redraw sequencer since media presence cache might have changed. */
|
|
|
|
|
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, nullptr);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_report_missing_files(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Report Missing Files";
|
|
|
|
|
ot->idname = "FILE_OT_report_missing_files";
|
2012-05-04 15:00:36 +00:00
|
|
|
ot->description = "Report all missing external files";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = report_missing_files_exec;
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = 0; /* only reports so no need to undo/register */
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Find Missing Files Operator
|
|
|
|
|
* \{ */
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2011-10-27 01:25:07 +00:00
|
|
|
static int find_missing_files_exec(bContext *C, wmOperator *op)
|
2009-06-30 19:20:45 +00:00
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
Main *bmain = CTX_data_main(C);
|
2023-06-09 09:44:08 +10:00
|
|
|
const char *searchpath = RNA_string_get_alloc(op->ptr, "directory", nullptr, 0, nullptr);
|
2013-06-24 02:57:06 +00:00
|
|
|
const bool find_all = RNA_boolean_get(op->ptr, "find_all");
|
|
|
|
|
|
|
|
|
|
BKE_bpath_missing_files_find(bmain, searchpath, op->reports, find_all);
|
2011-10-27 01:25:07 +00:00
|
|
|
MEM_freeN((void *)searchpath);
|
2024-04-24 19:54:44 +02:00
|
|
|
/* Redraw sequencer since media presence cache might have changed. */
|
|
|
|
|
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, nullptr);
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
static int find_missing_files_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
2009-06-30 19:20:45 +00:00
|
|
|
{
|
|
|
|
|
/* XXX file open button text "Find Missing Files" */
|
2018-06-04 09:31:30 +02:00
|
|
|
WM_event_add_fileselect(C, op);
|
2009-06-30 19:20:45 +00:00
|
|
|
return OPERATOR_RUNNING_MODAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FILE_OT_find_missing_files(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Find Missing Files";
|
|
|
|
|
ot->idname = "FILE_OT_find_missing_files";
|
2012-05-04 15:00:36 +00:00
|
|
|
ot->description = "Try to find missing external files";
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->exec = find_missing_files_exec;
|
|
|
|
|
ot->invoke = find_missing_files_invoke;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* flags */
|
2012-03-28 11:53:18 +00:00
|
|
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
/* properties */
|
2013-06-24 02:57:06 +00:00
|
|
|
RNA_def_boolean(ot->srna,
|
|
|
|
|
"find_all",
|
|
|
|
|
false,
|
|
|
|
|
"Find All",
|
|
|
|
|
"Find all files in the search path (not just missing)");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-02-07 22:56:20 +11:00
|
|
|
WM_operator_properties_filesel(ot,
|
|
|
|
|
0,
|
|
|
|
|
FILE_SPECIAL,
|
|
|
|
|
FILE_OPENFILE,
|
|
|
|
|
WM_FILESEL_DIRECTORY,
|
|
|
|
|
FILE_DEFAULTDISPLAY,
|
2020-11-02 23:55:59 +01:00
|
|
|
FILE_SORT_DEFAULT);
|
2009-06-30 19:20:45 +00:00
|
|
|
}
|
2010-06-03 07:27:55 +00:00
|
|
|
|
2021-05-05 12:12:20 +10:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Report Box Operator
|
|
|
|
|
* \{ */
|
2010-06-03 07:27:55 +00:00
|
|
|
|
2021-10-03 12:06:06 +11:00
|
|
|
/* NOTE(@broken): Hard to decide whether to keep this as an operator,
|
2021-07-08 13:26:55 +10:00
|
|
|
* or turn it into a hard_coded UI control feature,
|
2023-07-31 11:50:54 +10:00
|
|
|
* handling TIMER events for all regions in `interface_handlers.cc`.
|
2018-06-01 18:19:39 +02:00
|
|
|
* Not sure how good that is to be accessing UI data from
|
2021-07-08 13:26:55 +10:00
|
|
|
* inactive regions, so use this for now. */
|
2010-06-03 07:27:55 +00:00
|
|
|
|
2012-03-28 11:53:18 +00:00
|
|
|
#define INFO_TIMEOUT 5.0f
|
|
|
|
|
#define ERROR_TIMEOUT 10.0f
|
2019-03-28 17:54:35 +01:00
|
|
|
#define FLASH_TIMEOUT 1.0f
|
2012-03-28 11:53:18 +00:00
|
|
|
#define COLLAPSE_TIMEOUT 0.25f
|
2023-09-07 16:06:52 +10:00
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
static int update_reports_display_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event)
|
2010-06-03 07:27:55 +00:00
|
|
|
{
|
2012-03-28 11:53:18 +00:00
|
|
|
ReportList *reports = CTX_wm_reports(C);
|
2010-06-03 07:27:55 +00:00
|
|
|
Report *report;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-06-03 07:27:55 +00:00
|
|
|
/* escape if not our timer */
|
2023-06-09 09:44:08 +10:00
|
|
|
if ((reports->reporttimer == nullptr) || (reports->reporttimer != event->customdata) ||
|
|
|
|
|
((report = BKE_reports_last_displayable(reports)) == nullptr))
|
2012-03-28 11:53:18 +00:00
|
|
|
{
|
2023-05-02 09:32:44 +10:00
|
|
|
/* May have been deleted. */
|
2010-06-03 07:27:55 +00:00
|
|
|
return OPERATOR_PASS_THROUGH;
|
2010-12-02 21:40:39 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-09-07 16:06:52 +10:00
|
|
|
wmWindowManager *wm = CTX_wm_manager(C);
|
|
|
|
|
ReportTimerInfo *rti = (ReportTimerInfo *)reports->reporttimer->customdata;
|
|
|
|
|
const float flash_timeout = FLASH_TIMEOUT;
|
|
|
|
|
bool send_notifier = false;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-09-07 16:06:52 +10:00
|
|
|
const float timeout = (report->type & RPT_ERROR_ALL) ? ERROR_TIMEOUT : INFO_TIMEOUT;
|
|
|
|
|
const float time_duration = float(reports->reporttimer->time_duration);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-06-03 07:27:55 +00:00
|
|
|
/* clear the report display after timeout */
|
2023-09-07 16:06:52 +10:00
|
|
|
if (time_duration > timeout) {
|
2023-07-11 13:16:04 +10:00
|
|
|
WM_event_timer_remove(wm, nullptr, reports->reporttimer);
|
2023-06-09 09:44:08 +10:00
|
|
|
reports->reporttimer = nullptr;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-06-09 09:44:08 +10:00
|
|
|
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, nullptr);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-28 11:53:18 +00:00
|
|
|
return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);
|
2010-06-03 07:27:55 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-03-27 17:22:04 +00:00
|
|
|
if (rti->widthfac == 0.0f) {
|
2018-10-19 17:14:27 +02:00
|
|
|
rti->widthfac = 1.0f;
|
2010-06-03 07:27:55 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-09-07 16:06:52 +10:00
|
|
|
const float progress = powf(time_duration / timeout, 2.0f);
|
|
|
|
|
const float flash_progress = powf(time_duration / flash_timeout, 2.0);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-11-24 16:34:38 +00:00
|
|
|
/* save us from too many draws */
|
2019-03-28 17:54:35 +01:00
|
|
|
if (flash_progress <= 1.0f) {
|
2023-09-07 15:54:55 +10:00
|
|
|
/* Flash report briefly according to progress through fade-out duration. */
|
2023-09-07 16:06:52 +10:00
|
|
|
send_notifier = true;
|
2010-11-24 16:34:38 +00:00
|
|
|
}
|
2023-09-07 15:54:54 +10:00
|
|
|
rti->flash_progress = flash_progress;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-06-03 07:27:55 +00:00
|
|
|
/* collapse report at end of timeout */
|
2012-03-28 11:53:18 +00:00
|
|
|
if (progress * timeout > timeout - COLLAPSE_TIMEOUT) {
|
|
|
|
|
rti->widthfac = (progress * timeout - (timeout - COLLAPSE_TIMEOUT)) / COLLAPSE_TIMEOUT;
|
2011-03-27 17:22:04 +00:00
|
|
|
rti->widthfac = 1.0f - rti->widthfac;
|
2023-09-07 16:06:52 +10:00
|
|
|
send_notifier = true;
|
2010-06-03 07:27:55 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-09-07 16:06:52 +10:00
|
|
|
if (send_notifier) {
|
2023-06-09 09:44:08 +10:00
|
|
|
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, nullptr);
|
2010-11-24 16:34:38 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-28 11:53:18 +00:00
|
|
|
return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);
|
2010-06-03 07:27:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void INFO_OT_reports_display_update(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->name = "Update Reports Display";
|
|
|
|
|
ot->idname = "INFO_OT_reports_display_update";
|
2012-05-04 15:00:36 +00:00
|
|
|
ot->description = "Update the display of reports in Blender UI (internal use)";
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-06-03 07:27:55 +00:00
|
|
|
/* api callbacks */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->invoke = update_reports_display_invoke;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-06-03 07:27:55 +00:00
|
|
|
/* flags */
|
2012-03-22 07:26:09 +00:00
|
|
|
ot->flag = 0;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-06-03 07:27:55 +00:00
|
|
|
/* properties */
|
2010-06-09 14:04:34 +00:00
|
|
|
}
|
2010-11-11 13:36:57 +00:00
|
|
|
|
|
|
|
|
/* report operators */
|
2021-05-05 12:12:20 +10:00
|
|
|
|
|
|
|
|
/** \} */
|