From 7c253995765d3af5e3e292bddc88271096c10b82 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Tue, 9 Nov 2021 09:58:48 -0700 Subject: [PATCH 1/2] tests/benchmarks: Fix operation on windows The test script did not work on windows since it had some trouble importing the api module on the blender side of things. turning the file path to the module into a raw string literal sidesteps the backslash issue in the path. Differential Revision: https://developer.blender.org/D13163 Reviewed by: brecht --- tests/performance/api/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/performance/api/environment.py b/tests/performance/api/environment.py index eec92cc7b6b..235a1805ba9 100644 --- a/tests/performance/api/environment.py +++ b/tests/performance/api/environment.py @@ -235,7 +235,7 @@ class TestEnvironment: output_prefix = 'TEST_OUTPUT: ' expression = (f'import sys, pickle, base64\n' - f'sys.path.append("{package_path}")\n' + f'sys.path.append(r"{package_path}")\n' f'import {modulename}\n' f'args = pickle.loads(base64.b64decode({args}))\n' f'result = {modulename}.{functionname}(args)\n' From 44239fa106335d2f620978a33a9e9b1ad2905caf Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 9 Nov 2021 12:59:20 -0600 Subject: [PATCH 2/2] Fix: Crash with no active object after recent commit rBaa13c4b386b13111 added a check for the active object in drawing code, but it missed adding a check for the active base before trying to retrieve its object. --- source/blender/draw/intern/draw_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 9151c0bd68b..2cbea2ae6d5 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -295,9 +295,10 @@ int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color { const DRWContextState *draw_ctx = DRW_context_state_get(); const bool is_edit = (draw_ctx->object_mode & OB_MODE_EDIT) && (ob->mode & OB_MODE_EDIT); - const bool active = (ob->base_flag & BASE_FROM_DUPLI) ? - (DRW_object_get_dupli_parent(ob) == view_layer->basact->object) : - (view_layer->basact && view_layer->basact->object == ob); + const bool active = view_layer->basact && + ((ob->base_flag & BASE_FROM_DUPLI) ? + (DRW_object_get_dupli_parent(ob) == view_layer->basact->object) : + (view_layer->basact->object == ob)); /* confusing logic here, there are 2 methods of setting the color * 'colortab[colindex]' and 'theme_id', colindex overrides theme_id.