From 0c22ef5ae7c7ac8cb11d0670f698a104ae1be823 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Mon, 13 Oct 2025 12:53:17 +0200 Subject: [PATCH 1/3] Fix: Simplify import in VR add-on In the Viewport VR Preview, an unusual and complicated import manipulates sys.path to import a class from a file that is already importable anyway. There is no documented reason for this, and the common way to subclass an RNA type in python is by using its `bpy.types....` registered class, _not_ by directly subclassing the python type used to declare/register the parent type. Pull Request: https://projects.blender.org/blender/blender/pulls/147656 --- scripts/addons_core/viewport_vr_preview/gui.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/addons_core/viewport_vr_preview/gui.py b/scripts/addons_core/viewport_vr_preview/gui.py index ab90677c95e..7a918f19095 100644 --- a/scripts/addons_core/viewport_vr_preview/gui.py +++ b/scripts/addons_core/viewport_vr_preview/gui.py @@ -18,11 +18,7 @@ from bpy.types import ( Panel, UIList, ) -# Add space_view3d.py to module search path for VIEW3D_PT_object_type_visibility import. -import os.path -import sys -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../startup/bl_ui'))) -from space_view3d import VIEW3D_PT_object_type_visibility +from bpy.types import VIEW3D_PT_object_type_visibility # Session. From 84d99a5902f84e7087d81b8bd24943b2a9a62086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 13 Oct 2025 12:53:50 +0200 Subject: [PATCH 2/3] Fix: Timeline versioning conflict with pre-2.80 files Move the versioning code that switches the Timeline editor to Dope Sheet from the 'first' to the 'after linking' versioning stage. There was already versioning code that effectively turns the Dope Sheet back into a Timeline, for pre-2.80 files, and this runs in the 'after linking' stage. The 5.0 versioning code now correctly runs after this. Fixes: #147742 Pull Request: https://projects.blender.org/blender/blender/pulls/147734 --- .../blenloader/intern/versioning_500.cc | 62 ++++++++++--------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_500.cc b/source/blender/blenloader/intern/versioning_500.cc index 8eb96a4ccd5..4aca1992862 100644 --- a/source/blender/blenloader/intern/versioning_500.cc +++ b/source/blender/blenloader/intern/versioning_500.cc @@ -2687,6 +2687,39 @@ void do_versions_after_linking_500(FileData *fd, Main *bmain) } } + if (!MAIN_VERSION_FILE_ATLEAST(bmain, 500, 100)) { + /* Note: this HAS to happen in the 'after linking' stage, because + * #do_version_area_change_space_to_space_action() basically performs the opposite operation + * and is called from #do_versions_after_linking_280(). */ + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (!ELEM(sl->spacetype, SPACE_ACTION)) { + continue; + } + SpaceAction *saction = reinterpret_cast(sl); + const eAnimEdit_Context dopesheet_mode = eAnimEdit_Context(saction->mode); + if (dopesheet_mode != SACTCONT_TIMELINE) { + continue; + } + /* Switching to dopesheet since that is the closest to the timeline view. */ + saction->mode = SACTCONT_DOPESHEET; + /* The multiplication by 2 assumes that the time control footer has the same size as the + * header. The header is only shown if there is enough space for both. */ + const bool show_header = area->winy > (HEADERY * UI_SCALE_FAC) * 2; + LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { + if (!show_header && region->regiontype == RGN_TYPE_HEADER) { + region->flag |= RGN_FLAG_HIDDEN; + } + if (region->regiontype == RGN_TYPE_FOOTER) { + region->flag &= ~RGN_FLAG_HIDDEN; + } + } + } + } + } + } + if (!MAIN_VERSION_FILE_ATLEAST(bmain, 500, 101)) { const uint8_t default_flags = DNA_struct_default_get(ToolSettings)->fix_to_cam_flag; LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { @@ -3836,35 +3869,6 @@ void blo_do_versions_500(FileData *fd, Library * /*lib*/, Main *bmain) } } - if (!MAIN_VERSION_FILE_ATLEAST(bmain, 500, 100)) { - LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { - LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { - LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { - if (!ELEM(sl->spacetype, SPACE_ACTION)) { - continue; - } - SpaceAction *saction = reinterpret_cast(sl); - if (saction->mode != SACTCONT_TIMELINE) { - continue; - } - /* Switching to dopesheet since that is the closest to the timeline view. */ - saction->mode = SACTCONT_DOPESHEET; - /* The multiplication by 2 assumes that the time control footer has the same size as the - * header. The header is only shown if there is enough space for both. */ - const bool show_header = area->winy > (HEADERY * UI_SCALE_FAC) * 2; - LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { - if (!show_header && region->regiontype == RGN_TYPE_HEADER) { - region->flag |= RGN_FLAG_HIDDEN; - } - if (region->regiontype == RGN_TYPE_FOOTER) { - region->flag &= ~RGN_FLAG_HIDDEN; - } - } - } - } - } - } - if (!MAIN_VERSION_FILE_ATLEAST(bmain, 500, 102)) { LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { scene->r.time_jump_delta = 1.0f; From 4ce37852fe49c8903cea4c5da4ffa212c362bb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Foucault?= Date: Mon, 13 Oct 2025 14:35:42 +0200 Subject: [PATCH 3/3] GPU: Preprocessor: Remove disabled code before builtin parsing This avoid issues with drw_debug_ prefix being scanned in disabled code. Fixes assert in debug builds. Pull Request: https://projects.blender.org/blender/blender/pulls/147974 --- source/blender/gpu/glsl_preprocess/glsl_preprocess.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/gpu/glsl_preprocess/glsl_preprocess.hh b/source/blender/gpu/glsl_preprocess/glsl_preprocess.hh index 0f37b377b20..da8cc5bfc58 100644 --- a/source/blender/gpu/glsl_preprocess/glsl_preprocess.hh +++ b/source/blender/gpu/glsl_preprocess/glsl_preprocess.hh @@ -212,6 +212,9 @@ class Preprocessor { } str = remove_comments(str, report_error); threadgroup_variables_parsing(str); + if (language == BLENDER_GLSL || language == CPP) { + str = disabled_code_mutation(str, report_error); + } parse_builtins(str, filename); if (language == BLENDER_GLSL || language == CPP) { if (do_parse_function) { @@ -221,7 +224,6 @@ class Preprocessor { pragma_runtime_generated_parsing(str); pragma_once_linting(str, filename, report_error); } - str = disabled_code_mutation(str, report_error); str = include_parse_and_remove(str, report_error); str = pragmas_mutation(str, report_error); str = swizzle_function_mutation(str, report_error);