From 1f4b02a4d1934455cb9fb119bcd52aded029931e Mon Sep 17 00:00:00 2001 From: Jaume Bellet Date: Sun, 19 Nov 2023 19:51:57 +0100 Subject: [PATCH] unapply --- scripts/mblender/url_presets.py | 17 -- scripts/modules/bpy/utils/__init__.py | 6 +- scripts/modules/bpy_types.py | 59 +------ source/blender/CMakeLists.txt | 1 - .../blender/editors/include/UI_interface_c.hh | 3 - .../editors/interface/interface_layout.cc | 25 --- source/blender/makesrna/intern/rna_ui.cc | 15 +- source/blender/makesrna/intern/rna_ui_api.cc | 118 +------------- source/blender/mblender/CMakeLists.txt | 45 ------ source/blender/mblender/MB_blender.cc | 61 ------- source/blender/mblender/MB_blender.h | 13 -- source/blender/mblender/MB_patches.h | 149 ------------------ source/blender/mblender/patches/MB_0008.h | 1 - source/blender/mblender/patches/MB_0009.h | 1 - source/blender/mblender/patches/MB_0010.h | 1 - source/blender/mblender/patches/MB_0012.h | 1 - .../windowmanager/intern/wm_operators.cc | 1 - .../windowmanager/intern/wm_splash_screen.cc | 66 -------- source/blender/windowmanager/wm.hh | 1 - source/creator/CMakeLists.txt | 2 - source/creator/creator.cc | 4 - source/creator/creator_args.cc | 14 -- 22 files changed, 7 insertions(+), 597 deletions(-) delete mode 100644 scripts/mblender/url_presets.py delete mode 100644 source/blender/mblender/CMakeLists.txt delete mode 100644 source/blender/mblender/MB_blender.cc delete mode 100644 source/blender/mblender/MB_blender.h delete mode 100644 source/blender/mblender/MB_patches.h delete mode 100644 source/blender/mblender/patches/MB_0008.h delete mode 100644 source/blender/mblender/patches/MB_0009.h delete mode 100644 source/blender/mblender/patches/MB_0010.h delete mode 100644 source/blender/mblender/patches/MB_0012.h diff --git a/scripts/mblender/url_presets.py b/scripts/mblender/url_presets.py deleted file mode 100644 index c342d9ebc18..00000000000 --- a/scripts/mblender/url_presets.py +++ /dev/null @@ -1,17 +0,0 @@ -import bpy - -def register (): - # bpy.ops.wm.url_open_preset(type="MBLENDER") - - bpy.types.WM_OT_url_open_preset.preset_items.append( - (('MBLENDER', "Mechanicalblender.org", "Mechanical blender's official web-site"), - "https://www.mechanicalblender.org") - ) - bpy.types.WM_OT_url_open_preset.preset_items.append( - (('MBLENDER_DOC', "Mechanicalblender Doc", "Mechanical blender's documentation"), - "https://www.mechanicalblender.org/#documentation") - ) - -def unregister(): - pass - diff --git a/scripts/modules/bpy/utils/__init__.py b/scripts/modules/bpy/utils/__init__.py index 81a438ce8ac..94b7394971b 100644 --- a/scripts/modules/bpy/utils/__init__.py +++ b/scripts/modules/bpy/utils/__init__.py @@ -66,7 +66,7 @@ _preferences = _bpy.context.preferences _is_factory_startup = _bpy.app.factory_startup # Directories added to the start of `sys.path` for all of Blender's "scripts" directories. -_script_module_dirs = "startup", "modules","mblender" +_script_module_dirs = "startup", "modules" # Base scripts, this points to the directory containing: "modules" & "startup" (see `_script_module_dirs`). # In Blender's code-base this is `./scripts`. @@ -308,10 +308,6 @@ def load_scripts(*, reload_scripts=False, refresh_scripts=False, extensions=True for mod in modules_from_path(path, loaded_modules): test_register(mod) - if path_subdir == "mblender": - for mod in modules_from_path(path, loaded_modules): - test_register(mod) - if reload_scripts: # Update key-maps for key-map items referencing operators defined in "startup". # Without this, key-map items wont be set properly, see: #113309. diff --git a/scripts/modules/bpy_types.py b/scripts/modules/bpy_types.py index 99b4005c279..950a7a856fc 100644 --- a/scripts/modules/bpy_types.py +++ b/scripts/modules/bpy_types.py @@ -950,11 +950,6 @@ class AddonPreferences(StructRNA, metaclass=RNAMeta): __slots__ = () -class ReferencedDrawFunc: - def __init__(self, func): - self.func = func - self.used = False - class _GenericUI: __slots__ = () @@ -975,13 +970,6 @@ class _GenericUI: else: owner_names = None - if (hasattr(cls, "reference_debug") and cls.reference_debug): - print ("---") - # Reset drawn flag, to be able shown error if not used - for label in cls.referenced_post: - for ref in cls.referenced_post[label]: - ref.used = False - for func in draw_ls._draw_funcs: # Begin 'owner_id' filter. @@ -1005,38 +993,11 @@ class _GenericUI: self.layout.operator_context = operator_context_default - for label in cls.referenced_post: - for ref in cls.referenced_post[label]: - if ref.used == False: - print("ERR: ", label, " referenced not drawn in", self.__class__.__name__) - draw_funcs = draw_ls._draw_funcs = [cls.draw] cls.draw = draw_ls - cls.referenced_pre = {} - cls.referenced_post = {} - return draw_funcs - def draw_referenced_pre(cls, label): - if (hasattr(cls, "reference_debug") and cls.reference_debug): - print (label) - - cls._dyn_ui_initialize() - if label in cls.referenced_pre: - for ref in cls.referenced_pre[label]: - #need to get the context - ref.used = True - ref.func(cls, None) - - def draw_referenced_post(cls, label): - cls._dyn_ui_initialize() - if label in cls.referenced_post: - for ref in cls.referenced_post[label]: - #need to get the context - ref.used = True - ref.func(cls, None) - @staticmethod def _dyn_owner_apply(draw_func): from _bpy import _bl_owner_id_get @@ -1049,36 +1010,24 @@ class _GenericUI: return bool(getattr(cls.draw, "_draw_funcs", None)) @classmethod - def append(cls, draw_func, label_referenced = None): + def append(cls, draw_func): """ Append a draw function to this menu, takes the same arguments as the menus draw function """ draw_funcs = cls._dyn_ui_initialize() cls._dyn_owner_apply(draw_func) - - if label_referenced != None: - if not (label_referenced in cls.referenced_post): - cls.referenced_post[label_referenced] = [] - cls.referenced_post[label_referenced].append(ReferencedDrawFunc(draw_func)) - else: - draw_funcs.append(draw_func) + draw_funcs.append(draw_func) @classmethod - def prepend(cls, draw_func, label_referenced = None): + def prepend(cls, draw_func): """ Prepend a draw function to this menu, takes the same arguments as the menus draw function """ draw_funcs = cls._dyn_ui_initialize() cls._dyn_owner_apply(draw_func) - - if label_referenced != None: - if not (label_referenced in cls.referenced_pre): - cls.referenced_pre[label_referenced] = [] - cls.referenced_pre[label_referenced].append(ReferencedDrawFunc(draw_func)) - else: - draw_funcs.insert(0, draw_func) + draw_funcs.insert(0, draw_func) @classmethod def remove(cls, draw_func): diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index ba49a73e6c8..b6aa0d1d8b8 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -159,7 +159,6 @@ add_subdirectory(functions) add_subdirectory(makesdna) add_subdirectory(makesrna) add_subdirectory(compositor) -add_subdirectory(mblender) if(WITH_BLENDER_THUMBNAILER) add_subdirectory(blendthumb) diff --git a/source/blender/editors/include/UI_interface_c.hh b/source/blender/editors/include/UI_interface_c.hh index 46fd3cabfc7..b736a2d7cf0 100644 --- a/source/blender/editors/include/UI_interface_c.hh +++ b/source/blender/editors/include/UI_interface_c.hh @@ -2240,9 +2240,6 @@ void UI_menutype_draw(bContext *C, MenuType *mt, uiLayout *layout); */ void UI_paneltype_draw(bContext *C, PanelType *pt, uiLayout *layout); -void *uiLayoutGetParentObject(uiLayout *layout); -struct ExtensionRNA *uiLayoutGetParentRnaExt(uiLayout *layout); - /* Only for convenience. */ void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but); diff --git a/source/blender/editors/interface/interface_layout.cc b/source/blender/editors/interface/interface_layout.cc index 6d9b7943771..c7e11106fbb 100644 --- a/source/blender/editors/interface/interface_layout.cc +++ b/source/blender/editors/interface/interface_layout.cc @@ -164,10 +164,6 @@ struct uiLayout { eUIEmbossType emboss; /** for fixed width or height to avoid UI size changes */ float units[2]; - - ExtensionRNA *parent_rna_ext; - void *parent_object; - }; struct uiLayoutItemFlow { @@ -5875,20 +5871,6 @@ bContextStore *uiLayoutGetContextStore(uiLayout *layout) return layout->context; } -void *uiLayoutGetParentObject(uiLayout * layout) -{ - return layout->parent_object; -} - -ExtensionRNA *uiLayoutGetParentRnaExt(uiLayout *layout) -{ - // rna ext is set on menu draw, layout maybe a sublayout - while (layout && layout->parent_rna_ext == NULL) { - layout = layout->parent; - } - return layout ? layout->parent_rna_ext : NULL; -} - void uiLayoutContextCopy(uiLayout *layout, const bContextStore *context) { uiBlock *block = layout->root->block; @@ -5983,9 +5965,6 @@ void UI_menutype_draw(bContext *C, MenuType *mt, uiLayout *layout) menu.layout = layout; menu.type = mt; - layout->parent_rna_ext = &mt->rna_ext; - layout->parent_object = (void*) &menu; - if (G.debug & G_DEBUG_WM) { printf("%s: opening menu \"%s\"\n", __func__, mt->idname); } @@ -6008,10 +5987,6 @@ void UI_menutype_draw(bContext *C, MenuType *mt, uiLayout *layout) if (layout->context) { CTX_store_set(C, nullptr); } - - layout->parent_rna_ext = NULL; - layout->parent_object = NULL; - } static bool ui_layout_has_panel_label(const uiLayout *layout, const PanelType *pt) diff --git a/source/blender/makesrna/intern/rna_ui.cc b/source/blender/makesrna/intern/rna_ui.cc index 16a5ccf217f..a53413e323b 100644 --- a/source/blender/makesrna/intern/rna_ui.cc +++ b/source/blender/makesrna/intern/rna_ui.cc @@ -969,7 +969,7 @@ static StructRNA *rna_Menu_register(Main *bmain, const char *error_prefix = "Registering menu class:"; MenuType *mt, dummy_mt = {nullptr}; Menu dummy_menu = {nullptr}; - bool have_function[4]; + bool have_function[2]; size_t over_alloc = 0; /* Warning, if this becomes a mess, we better do another allocation. */ size_t description_size = 0; char _menu_descr[RNA_DYN_DESCR_MAX]; @@ -2042,19 +2042,6 @@ static void rna_def_menu(BlenderRNA *brna) parm = RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); - /* draw referenced */ - func = RNA_def_function(srna, "draw_referenced_pre", nullptr); - RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout before reference"); - RNA_def_function_flag(func, FUNC_REGISTER); - parm = RNA_def_string(func, "label", nullptr, 0, "", "draw reference menu label"); - RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); - - func = RNA_def_function(srna, "draw_referenced_post", nullptr); - RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout after reference"); - RNA_def_function_flag(func, FUNC_REGISTER); - parm = RNA_def_string(func, "label", nullptr, 0, "", "draw reference menu label"); - RNA_def_parameter_flags(parm,PropertyFlag(0), PARM_REQUIRED); - RNA_define_verify_sdna(false); /* not in sdna */ prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_ui_api.cc b/source/blender/makesrna/intern/rna_ui_api.cc index ec1d51f9b0c..b04e1ba5c3b 100644 --- a/source/blender/makesrna/intern/rna_ui_api.cc +++ b/source/blender/makesrna/intern/rna_ui_api.cc @@ -11,7 +11,6 @@ #include "BLI_utildefines.h" -#include "BLI_string.h" #include "BLT_translation.h" #include "RNA_define.hh" @@ -327,63 +326,6 @@ static void rna_uiItemPointerR(uiLayout *layout, layout, ptr, prop, searchptr, searchprop, name, icon, results_are_suggestions); } -static void rna_call_draw_referenced(uiLayout *layout, const char *name, FunctionRNA *func) -{ - if (*name == '\0') { - return; - } - - char *label = (char*) MEM_callocN(255, __func__); // Error defined as not dinamic [] - BLI_strncpy(label, name, 255); - - - // Remove ... added in some menus, like Open... - size_t label_len = BLI_strnlen(name, 255); - if (label_len > 4) { - char *end = label + label_len; - if (*(end - 1) == '.' && *(end - 2) == '.' && *(end - 3) == '.') { - *(end - 3) = '\0'; - } - } - - - ExtensionRNA *ext_rna = uiLayoutGetParentRnaExt(layout); - if (ext_rna) { - PointerRNA ptr = RNA_pointer_create(NULL, ext_rna->srna, uiLayoutGetParentObject(layout)); - ParameterList list; - RNA_parameter_list_create(&list, &ptr, func); - // Do not know how the get the context, is lost on python RNA call. - // RNA_parameter_set_lookup(&list, "context", &C); - // rna_ext->call((bContext *)C, &ptr, func, &list); - RNA_parameter_set_lookup(&list, "label", &label); - ext_rna->call(NULL, &ptr, func, &list); - RNA_parameter_list_free(&list); - } - - MEM_freeN(label); -} - -static void rna_call_draw_referenced_pre(uiLayout *layout, const char *name) -{ - - extern FunctionRNA rna_Menu_draw_referenced_pre_func; - FunctionRNA *func; - func = &rna_Menu_draw_referenced_pre_func; /* RNA_struct_find_function(&ptr, - "draw_referenced_pre") */ - rna_call_draw_referenced(layout, name, func); -} - -static void rna_call_draw_referenced_post(uiLayout *layout, const char *name) -{ - extern FunctionRNA rna_Menu_draw_referenced_post_func; - - FunctionRNA *func; - func = &rna_Menu_draw_referenced_post_func; /* RNA_struct_find_function(&ptr, "draw_referenced_post") */ - - rna_call_draw_referenced(layout, name, func); -} - - static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, @@ -395,11 +337,6 @@ static PointerRNA rna_uiItemO(uiLayout *layout, int icon_value) { wmOperatorType *ot; - char original_name[255] = {0}; - - if (name) { - BLI_strncpy(original_name, name, 255); - } ot = WM_operatortype_find(opname, false); /* print error next */ if (!ot || !ot->srna) { @@ -407,13 +344,6 @@ static PointerRNA rna_uiItemO(uiLayout *layout, return PointerRNA_NULL; } - if (name && *name != '\0') { - BLI_strncpy(original_name, name, 255); - } - else { - BLI_strncpy(original_name, ot->name, 255); - } - /* Get translated name (label). */ name = rna_translate_ui_text(name, text_ctxt, ot->srna, nullptr, translate); @@ -428,15 +358,10 @@ static PointerRNA rna_uiItemO(uiLayout *layout, flag |= UI_ITEM_O_DEPRESS; } - rna_call_draw_referenced_pre(layout, original_name); - PointerRNA opptr; uiItemFullO_ptr( layout, ot, name, icon, nullptr, uiLayoutGetOperatorContext(layout), flag, &opptr); - - rna_call_draw_referenced_post(layout, original_name); - -return opptr; + return opptr; } static PointerRNA rna_uiItemOMenuHold(uiLayout *layout, @@ -480,17 +405,8 @@ static void rna_uiItemsEnumO(uiLayout *layout, const char *propname, const bool icon_only) { - - wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */ - - /** Calling only once per operator **/ - rna_call_draw_referenced_pre(layout, ot->name); - eUI_Item_Flag flag = icon_only ? UI_ITEM_R_ICON_ONLY : UI_ITEM_NONE; uiItemsFullEnumO(layout, opname, propname, nullptr, uiLayoutGetOperatorContext(layout), flag); - - rna_call_draw_referenced_post(layout, ot->name); - } static PointerRNA rna_uiItemMenuEnumO(uiLayout *layout, @@ -504,12 +420,6 @@ static PointerRNA rna_uiItemMenuEnumO(uiLayout *layout, { wmOperatorType *ot = WM_operatortype_find(opname, false); /* print error next */ - char original_name[255] = {0}; - - if (name) { - BLI_strncpy(original_name, name, 255); - } - if (!ot || !ot->srna) { RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname); return PointerRNA_NULL; @@ -518,13 +428,8 @@ static PointerRNA rna_uiItemMenuEnumO(uiLayout *layout, /* Get translated name (label). */ name = rna_translate_ui_text(name, text_ctxt, ot->srna, nullptr, translate); - rna_call_draw_referenced_pre(layout, original_name); - PointerRNA opptr; uiItemMenuEnumFullO_ptr(layout, C, ot, propname, name, icon, &opptr); - - rna_call_draw_referenced_post(layout, original_name); - return opptr; } @@ -560,33 +465,12 @@ static void rna_uiItemM(uiLayout *layout, icon = icon_value; } - MenuType *mt = WM_menutype_find(menuname, false); - if (mt == NULL) { - RNA_warning("not found %s", menuname); - return; - } - - rna_call_draw_referenced_pre(layout, mt->label); - uiItemM(layout, menuname, name, icon); - - rna_call_draw_referenced_post(layout, mt->label); } static void rna_uiItemM_contents(uiLayout *layout, const char *menuname) { - - MenuType *mt = WM_menutype_find(menuname, false); - if (mt == NULL) { - RNA_warning("not found %s", menuname); - return; - } - - rna_call_draw_referenced_pre(layout, mt->label); - uiItemMContents(layout, menuname); - - rna_call_draw_referenced_post(layout, mt->label); } static void rna_uiItemPopoverPanel(uiLayout *layout, diff --git a/source/blender/mblender/CMakeLists.txt b/source/blender/mblender/CMakeLists.txt deleted file mode 100644 index 0147a67b9fa..00000000000 --- a/source/blender/mblender/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# -# -# - - -set(INC - . - ../blenlib -) - -set(LIB - PRIVATE bf::blenlib -) - - -if(WITH_BOOST) - list(APPEND INC_SYS - ${BOOST_INCLUDE_DIR} - ) -else() - message (FATAL_ERROR "mblender requires WITH_BOOST") -endif() - -# Auto fill source files, so patches will not touch that file -file(GLOB sources "MB_*") -foreach(source ${sources}) - get_filename_component(name ${source} NAME) - list(APPEND SRC "${name}") -endforeach() - -# Generate a Definition for each found patch -file(GLOB patches "patches/*") - foreach(patch ${patches}) - get_filename_component(def ${patch} NAME_WE) - get_filename_component(name ${patch} NAME) - if (${name} MATCHES "^MB_[0-9][0-9][0-9][0-9]\.h$" ) - add_definitions(-D${def}) - list(APPEND SRC "patches/${name}") - else() - message (FATAL_ERROR "invalid patch file ${name}") - endif () -endforeach() - - -blender_add_lib(mblender "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --git a/source/blender/mblender/MB_blender.cc b/source/blender/mblender/MB_blender.cc deleted file mode 100644 index e9aaf8ed92c..00000000000 --- a/source/blender/mblender/MB_blender.cc +++ /dev/null @@ -1,61 +0,0 @@ -/** - * - */ - -#include "MB_patches.h" - -#include - -#include -#include - -char patches[MAX_MB_PATCHES][8] = {0}; - -void MB_patches_discover() -{ - int i = 0; - - BOOST_PP_IF(MB_0001_APPLIED, strcpy(patches[i++], "MB_0001"), ); - BOOST_PP_IF(MB_0002_APPLIED, strcpy(patches[i++], "MB_0002"), ); - BOOST_PP_IF(MB_0003_APPLIED, strcpy(patches[i++], "MB_0003"), ); - BOOST_PP_IF(MB_0004_APPLIED, strcpy(patches[i++], "MB_0004"), ); - BOOST_PP_IF(MB_0005_APPLIED, strcpy(patches[i++], "MB_0005"), ); - BOOST_PP_IF(MB_0006_APPLIED, strcpy(patches[i++], "MB_0006"), ); - BOOST_PP_IF(MB_0007_APPLIED, strcpy(patches[i++], "MB_0007"), ); - BOOST_PP_IF(MB_0008_APPLIED, strcpy(patches[i++], "MB_0008"), ); - BOOST_PP_IF(MB_0009_APPLIED, strcpy(patches[i++], "MB_0009"), ); - BOOST_PP_IF(MB_0010_APPLIED, strcpy(patches[i++], "MB_0010"), ); - BOOST_PP_IF(MB_0011_APPLIED, strcpy(patches[i++], "MB_0011"), ); - BOOST_PP_IF(MB_0012_APPLIED, strcpy(patches[i++], "MB_0012"), ); - BOOST_PP_IF(MB_0013_APPLIED, strcpy(patches[i++], "MB_0013"), ); - BOOST_PP_IF(MB_0014_APPLIED, strcpy(patches[i++], "MB_0014"), ); - BOOST_PP_IF(MB_0015_APPLIED, strcpy(patches[i++], "MB_0015"), ); - BOOST_PP_IF(MB_0016_APPLIED, strcpy(patches[i++], "MB_0016"), ); - BOOST_PP_IF(MB_0017_APPLIED, strcpy(patches[i++], "MB_0017"), ); - BOOST_PP_IF(MB_0018_APPLIED, strcpy(patches[i++], "MB_0018"), ); - BOOST_PP_IF(MB_0019_APPLIED, strcpy(patches[i++], "MB_0019"), ); - BOOST_PP_IF(MB_0020_APPLIED, strcpy(patches[i++], "MB_0020"), ); - - return; -} - -void MB_init(void) { - MB_patches_discover(); -} - -char** MB_patches_get() { - return (char**) patches; -} - -void MB_print_info() -{ - printf("%s", "Mechanical Blender Info\n"); - printf("%s", "---------------------\n"); - for (int i = 0; i < MAX_MB_PATCHES; i++) { - if (*patches[i] != '\0') { - printf("Applied Patch %s\n", patches[i]); - } - } - printf("%s", "---------------------\n"); -} - diff --git a/source/blender/mblender/MB_blender.h b/source/blender/mblender/MB_blender.h deleted file mode 100644 index e3b2ab2387c..00000000000 --- a/source/blender/mblender/MB_blender.h +++ /dev/null @@ -1,13 +0,0 @@ -/** - * - */ - -#ifndef MB_BLENDER_H -#define MB_BLENDER_H - -void MB_init(void); -void MB_patches_discover(void); -void MB_patches_get(void); -void MB_print_info(void); - -#endif diff --git a/source/blender/mblender/MB_patches.h b/source/blender/mblender/MB_patches.h deleted file mode 100644 index 874202928dc..00000000000 --- a/source/blender/mblender/MB_patches.h +++ /dev/null @@ -1,149 +0,0 @@ -#ifndef MB_BLENDER_PATCHES_H -#define MB_BLENDER_PATCHES_H - -#ifdef MB_0001 -#include "patches/MB_0001.h" -#define MB_0001_APPLIED 1 -#else -#define MB_0001_APPLIED 0 -#endif - -#ifdef MB_0002 -#include "patches/MB_0002.h" -#define MB_0002_APPLIED 1 -#else -#define MB_0002_APPLIED 0 -#endif - -#ifdef MB_0003 -#include "patches/MB_0003.h" -#define MB_0003_APPLIED 1 -#else -# define MB_0003_APPLIED 0 -#endif - -#ifdef MB_0004 -#include "patches/MB_0004.h" -#define MB_0004_APPLIED 1 -#else -# define MB_0004_APPLIED 0 -#endif - -#ifdef MB_0005 -#include "patches/MB_0005.h" -#define MB_0005_APPLIED 1 -#else -# define MB_0005_APPLIED 0 -#endif - -#ifdef MB_0006 -#include "patches/MB_0006.h" -#define MB_0006_APPLIED 1 -#else -#define MB_0006_APPLIED 0 -#endif - -#ifdef MB_0007 -#include "patches/MB_0007.h" -#define MB_0007_APPLIED 1 -#else -#define MB_0007_APPLIED 0 -#endif - -#ifdef MB_0008 -#include "patches/MB_0008.h" -#define MB_0008_APPLIED 1 -#else -#define MB_0008_APPLIED 0 -#endif - -#ifdef MB_0009 -#include "patches/MB_0009.h" -#define MB_0009_APPLIED 1 -#else -#define MB_0009_APPLIED 0 -#endif - -#ifdef MB_0010 -#include "patches/MB_0010.h" -#define MB_0010_APPLIED 1 -#else -#define MB_0010_APPLIED 0 -#endif - -#ifdef MB_0011 -#include "patches/MB_0011.h" -#define MB_0011_APPLIED 1 -#else -#define MB_0011_APPLIED 0 -#endif - -#ifdef MB_0012 -#include "patches/MB_0012.h" -#define MB_0012_APPLIED 1 -#else -#define MB_0012_APPLIED 0 -#endif - -#ifdef MB_0013 -#include "patches/MB_0013.h" -#define MB_0013_APPLIED 1 -#else -#define MB_0013_APPLIED 0 -#endif - -#ifdef MB_0014 -#include "patches/MB_0014.h" -#define MB_0014_APPLIED 1 -#else -#define MB_0014_APPLIED 0 -#endif - -#ifdef MB_0015 -#include "patches/MB_0015.h" -#define MB_0015_APPLIED 1 -#else -#define MB_0015_APPLIED 0 -#endif - -#ifdef MB_0016 -#include "patches/MB_0016.h" -#define MB_0016_APPLIED 1 -#else -#define MB_0016_APPLIED 0 -#endif - -#ifdef MB_0017 -#include "patches/MB_0017.h" -#define MB_0017_APPLIED 1 -#else -#define MB_0017_APPLIED 0 -#endif - -#ifdef MB_0018 -#include "patches/MB_0018.h" -#define MB_0018_APPLIED 1 -#else -#define MB_0018_APPLIED 0 -#endif - -#ifdef MB_0019 -#include "patches/MB_0019.h" -#define MB_0019_APPLIED 1 -#else -#define MB_0019_APPLIED 0 -#endif - -#ifdef MB_0020 -#include "patches/MB_0020.h" -#define MB_0020_APPLIED 1 -#else -#define MB_0020_APPLIED 0 -#endif - -#ifndef MB_0021 -#define MAX_MB_PATCHES 21 -#endif - - -#endif // !MB_BLENDER_PATCHES_H diff --git a/source/blender/mblender/patches/MB_0008.h b/source/blender/mblender/patches/MB_0008.h deleted file mode 100644 index 8ac91a5f12f..00000000000 --- a/source/blender/mblender/patches/MB_0008.h +++ /dev/null @@ -1 +0,0 @@ -/* Empty file */ diff --git a/source/blender/mblender/patches/MB_0009.h b/source/blender/mblender/patches/MB_0009.h deleted file mode 100644 index c978e52a11c..00000000000 --- a/source/blender/mblender/patches/MB_0009.h +++ /dev/null @@ -1 +0,0 @@ -/* Empty File */ \ No newline at end of file diff --git a/source/blender/mblender/patches/MB_0010.h b/source/blender/mblender/patches/MB_0010.h deleted file mode 100644 index c978e52a11c..00000000000 --- a/source/blender/mblender/patches/MB_0010.h +++ /dev/null @@ -1 +0,0 @@ -/* Empty File */ \ No newline at end of file diff --git a/source/blender/mblender/patches/MB_0012.h b/source/blender/mblender/patches/MB_0012.h deleted file mode 100644 index a5de9533beb..00000000000 --- a/source/blender/mblender/patches/MB_0012.h +++ /dev/null @@ -1 +0,0 @@ -/* Empty File */ diff --git a/source/blender/windowmanager/intern/wm_operators.cc b/source/blender/windowmanager/intern/wm_operators.cc index c499ded3ed0..5b983c4d257 100644 --- a/source/blender/windowmanager/intern/wm_operators.cc +++ b/source/blender/windowmanager/intern/wm_operators.cc @@ -3898,7 +3898,6 @@ void wm_operatortypes_register() WM_operatortype_append(WM_OT_operator_defaults); WM_operatortype_append(WM_OT_splash); WM_operatortype_append(WM_OT_splash_about); - WM_operatortype_append(WM_OT_splash_custom); WM_operatortype_append(WM_OT_search_menu); WM_operatortype_append(WM_OT_search_operator); WM_operatortype_append(WM_OT_search_single_menu); diff --git a/source/blender/windowmanager/intern/wm_splash_screen.cc b/source/blender/windowmanager/intern/wm_splash_screen.cc index 04e25730b69..96eda527605 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.cc +++ b/source/blender/windowmanager/intern/wm_splash_screen.cc @@ -49,9 +49,6 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "RNA_define.hh" -#include "RNA_access.hh" - #include "wm.hh" static void wm_block_close(bContext *C, void *arg_block, void * /*arg*/) @@ -339,66 +336,3 @@ void WM_OT_splash_about(wmOperatorType *ot) ot->invoke = wm_about_invoke; ot->poll = WM_operator_winactive; } - -static uiBlock *wm_block_create_custom_splash(bContext *C, ARegion *region, void *arg) { - - char *menutype_str = (char*) arg; - - const uiStyle *style = UI_style_get_dpi(); - const int text_points_max = MAX2(style->widget.points, style->widgetlabel.points); - const int dialog_width = text_points_max * 42 * UI_SCALE_FAC; - - uiBlock *block = UI_block_begin(C, region, "about", UI_EMBOSS); - - UI_block_flag_enable(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_LOOP | UI_BLOCK_NO_WIN_CLIP); - UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP); - - uiLayout *layout = UI_block_layout( - block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, dialog_width, 0, 0, style); - - uiLayout *col = uiLayoutColumn(layout, true); - - MenuType *mt = WM_menutype_find(menutype_str, true); - if (mt) { - UI_menutype_draw(C, mt, col); - } else { - CLOG_ERROR(WM_LOG_OPERATORS, "cannot find WM menutype '%s'", menutype_str); - } - - UI_block_bounds_set_centered(block, 22 * UI_SCALE_FAC); - - return block; -} - -static int wm_about_custom_exec(bContext *C, wmOperator *op) -{ - char *menutype_str = MEM_cnew_array(100, __func__); - *menutype_str = '\0'; - - if (RNA_struct_property_is_set(op->ptr, "menutype")) { - RNA_string_get(op->ptr, "menutype", menutype_str); - } - - UI_popup_block_invoke(C, wm_block_create_custom_splash, menutype_str, MEM_freeN); - - return OPERATOR_FINISHED; -} - -static int wm_about_custom_invoke(bContext *C, wmOperator *op , const wmEvent * /*event*/) { - return op->type->exec(C, op); -} - -void WM_OT_splash_custom(wmOperatorType *ot) -{ - PropertyRNA *prop; - prop = RNA_def_string(ot->srna, "menutype", "MT_", 100, "", "MenuType class name"); - - ot->name = "Custom Splash"; - ot->idname = "WM_OT_splash_custom"; - ot->description = "Open a splash window with some custom information"; - - ot->exec = wm_about_custom_exec; - ot->invoke = wm_about_custom_invoke; - ot->poll = WM_operator_winactive; - -} diff --git a/source/blender/windowmanager/wm.hh b/source/blender/windowmanager/wm.hh index 665413d651f..98754fa821f 100644 --- a/source/blender/windowmanager/wm.hh +++ b/source/blender/windowmanager/wm.hh @@ -98,7 +98,6 @@ void wm_autosave_delete(); void WM_OT_splash(wmOperatorType *ot); void WM_OT_splash_about(wmOperatorType *ot); -void WM_OT_splash_custom(wmOperatorType *ot); /* `wm_stereo.cc` */ diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index add11325c78..443e190e2d9 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -14,7 +14,6 @@ set(INC ../blender/makesrna ../blender/render ../blender/windowmanager - ../blender/mblender ) set(LIB @@ -22,7 +21,6 @@ set(LIB PRIVATE bf::dna PRIVATE bf::intern::guardedalloc bf_windowmanager - mblender ) if(HAVE_FEENABLEEXCEPT) diff --git a/source/creator/creator.cc b/source/creator/creator.cc index 362b5f4963f..75562a114dc 100644 --- a/source/creator/creator.cc +++ b/source/creator/creator.cc @@ -57,8 +57,6 @@ #include "BKE_vfont.h" #include "BKE_volume.h" -#include "MB_blender.h" - #ifndef WITH_PYTHON_MODULE # include "BLI_args.h" #endif @@ -491,8 +489,6 @@ int main(int argc, /* Initialize sub-systems that use `BKE_appdir.h`. */ IMB_init(); - MB_init(); - #ifndef WITH_PYTHON_MODULE /* First test for background-mode (#Global.background) */ BLI_args_parse(ba, ARG_PASS_SETTINGS, nullptr, nullptr); diff --git a/source/creator/creator_args.cc b/source/creator/creator_args.cc index ba66b6ba809..1b2f2973509 100644 --- a/source/creator/creator_args.cc +++ b/source/creator/creator_args.cc @@ -47,8 +47,6 @@ # include "GPU_context.h" -# include "MB_blender.h" - # ifdef WITH_FFMPEG # include "IMB_imbuf.h" # endif @@ -1485,16 +1483,6 @@ static int arg_handle_start_with_console(int /*argc*/, const char ** /*argv*/, v return 0; } - -static const char arg_handle_mblender_info_doc[] = - "\n\t" - "Shows Mechanical Blender info on loading."; -static int arg_handle_mblender_info(int /*argc*/, const char ** /*argv*/, void * /*data*/) -{ - MB_print_info(); - return 0; -} - static const char arg_handle_register_extension_doc[] = "\n\t" "Register blend-file extension for current user, then exit (Windows only)."; @@ -2539,8 +2527,6 @@ void main_args_setup(bContext *C, bArgs *ba, bool all) BLI_args_add(ba, nullptr, "--open-last", CB(arg_handle_load_last_file), C); - BLI_args_add(ba, nullptr, "--mblender-info", CB(arg_handle_mblender_info), nullptr); - # undef CB # undef CB_EX # undef CB_ALL