From 6f0229b3a058c647f600e32627342b1f58ec6d0a Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 16 Jun 2025 10:27:40 -0400 Subject: [PATCH] Cleanup: Remove unused Python OpenGL warning popup Unused since decd88f67efab2e622cf6c81ec62b9d93bb8bd7a --- source/blender/python/gpu/gpu_py_shader.cc | 8 --- .../blender/windowmanager/intern/wm_window.cc | 57 ------------------- 2 files changed, 65 deletions(-) diff --git a/source/blender/python/gpu/gpu_py_shader.cc b/source/blender/python/gpu/gpu_py_shader.cc index 80e0cb62f7b..b672dd23bec 100644 --- a/source/blender/python/gpu/gpu_py_shader.cc +++ b/source/blender/python/gpu/gpu_py_shader.cc @@ -106,14 +106,6 @@ static int pygpu_shader_uniform_location_get(GPUShader *shader, /** \name Shader Type * \{ */ -static std::optional c_str_to_stringref_opt(const char *str) -{ - if (!str) { - return std::nullopt; - } - return blender::StringRefNull(str); -} - PyDoc_STRVAR( /* Wrap. */ pygpu_shader_bind_doc, diff --git a/source/blender/windowmanager/intern/wm_window.cc b/source/blender/windowmanager/intern/wm_window.cc index e7f0ca4b23a..6298576bc99 100644 --- a/source/blender/windowmanager/intern/wm_window.cc +++ b/source/blender/windowmanager/intern/wm_window.cc @@ -2086,63 +2086,6 @@ GHOST_TDrawingContextType wm_ghost_drawing_context_type(const eGPUBackendType gp return GHOST_kDrawingContextTypeNone; } -static uiBlock *block_create_opengl_usage_warning(bContext *C, ARegion *region, void * /*arg1*/) -{ - uiBlock *block = UI_block_begin( - C, region, "autorun_warning_popup", blender::ui::EmbossType::Emboss); - UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP); - UI_block_emboss_set(block, blender::ui::EmbossType::Emboss); - - const char *title = RPT_("Python script uses OpenGL for drawing"); - const char *message1 = RPT_("This may lead to unexpected behavior"); - const char *message2 = RPT_( - "One of the add-ons or scripts is using OpenGL and will not work correct on Metal"); - const char *message3 = RPT_( - "Please contact the developer of the add-on to migrate to use 'gpu' module"); - const char *message4 = RPT_("See system tab in preferences to switch to OpenGL backend"); - - /* Measure strings to find the longest. */ - const uiStyle *style = UI_style_get_dpi(); - UI_fontstyle_set(&style->widget); - int text_width = int(BLF_width(style->widget.uifont_id, title, BLF_DRAW_STR_DUMMY_MAX)); - text_width = std::max(text_width, - int(BLF_width(style->widget.uifont_id, message1, BLF_DRAW_STR_DUMMY_MAX))); - text_width = std::max(text_width, - int(BLF_width(style->widget.uifont_id, message2, BLF_DRAW_STR_DUMMY_MAX))); - text_width = std::max(text_width, - int(BLF_width(style->widget.uifont_id, message3, BLF_DRAW_STR_DUMMY_MAX))); - text_width = std::max(text_width, - int(BLF_width(style->widget.uifont_id, message4, BLF_DRAW_STR_DUMMY_MAX))); - - const int dialog_width = std::max(int(400.0f * UI_SCALE_FAC), - text_width + int(style->columnspace * 2.5)); - - const short icon_size = 40 * UI_SCALE_FAC; - uiLayout *layout = uiItemsAlertBox( - block, style, dialog_width + icon_size, ALERT_ICON_ERROR, icon_size); - - uiLayout *col = &layout->column(false); - col->scale_y_set(0.9f); - - /* Title and explanation text. */ - uiItemL_ex(col, title, ICON_NONE, true, false); - col->separator(0.8f, LayoutSeparatorType::Space); - - uiLayout *messages = &col->column(false); - messages->scale_y_set(0.8f); - - messages->label(message1, ICON_NONE); - messages->label(message2, ICON_NONE); - messages->label(message3, ICON_NONE); - messages->label(message4, ICON_NONE); - - col->separator(0.5f, LayoutSeparatorType::Space); - - UI_block_bounds_set_centered(block, 14 * UI_SCALE_FAC); - - return block; -} - static uiBlock *block_create_gpu_backend_fallback(bContext *C, ARegion *region, void * /*arg1*/) { uiBlock *block = UI_block_begin(