From 81022000063c1fe84d85e8de416d8ab0c2c4c516 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 16 Jan 2019 19:41:29 +0100 Subject: Cleanup/sanitize usages of G.debug_value. There was no documentation at all, some very bad practices (like using G.debug_value > 0 as some sort of global debug print switch), and even an overlapping use of '1' value... Also, python setter did not check for valid range (since this is a short, not an int). --- source/blender/blenkernel/BKE_global.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_global.h') diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index b2991679775..97e23a952db 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -73,7 +73,21 @@ typedef struct Global { /* to indicate render is busy, prevent renderwindow events etc */ bool is_rendering; - /* debug value, can be set from the UI and python, used for testing nonstandard features */ + /* Debug value, can be set from the UI and python, used for testing nonstandard features. + * DO NOT abuse it with generic checks like `if (G.debug_value > 0)`. Do not use it as bitflags. + * Only precise specific values should be checked for, to avoid unpredictable side-effects. + * Please document here the value(s) you are using (or a range of values reserved to some area). + * * -16384 and below: Reserved for python (add-ons) usage. + * * -1: Disable faster motion paths computation (since 08/2018). + * * 1 - 30: EEVEE debug/stats values (01/2018). + * * 101: Enable UI debug drawing of fullscreen area's corner widget (10/2014). + * * 527: Old mysterious switch in behavior of MeshDeform modifier (before 04/2010). + * * 777: Enable UI node panel's sockets polling (11/2011). + * * 799: Enable some mysterious new depsgraph behavior (05/2015). + * * 1112: Disable new Cloth internal springs hanlding (09/2014). + * * 1234: Disable new dyntopo code fixing skinny faces generation (04/2015). + * * 16384 and above: Reserved for python (add-ons) usage. + */ short debug_value; /* saved to the blend file as FileGlobal.globalf, -- cgit v1.2.3