This commit is contained in:
Jaume Bellet 2023-11-19 19:51:57 +01:00
parent bc37e5c2b5
commit 1f4b02a4d1
22 changed files with 7 additions and 597 deletions

View File

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

View File

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

View File

@ -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):

View File

@ -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)

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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,

View File

@ -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}")

View File

@ -1,61 +0,0 @@
/**
*
*/
#include "MB_patches.h"
#include <boost/preprocessor/if.hpp>
#include <stdio.h>
#include <string.h>
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");
}

View File

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

View File

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

View File

@ -1 +0,0 @@
/* Empty file */

View File

@ -1 +0,0 @@
/* Empty File */

View File

@ -1 +0,0 @@
/* Empty File */

View File

@ -1 +0,0 @@
/* Empty File */

View File

@ -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);

View File

@ -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<char>(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;
}

View File

@ -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` */

View File

@ -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)

View File

@ -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);

View File

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