Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2015-01-21 16:00:59 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-21 16:00:59 +0300
commitf087e9930d5b8c876206af117ce085dec0ec4578 (patch)
tree930007bcfbd15d1ec5f8a64b94a55529e6facdea /source
parentf23338e107503ea9cddaa1e0155556f750c8c15a (diff)
Added new debug flag which can be used to lazy-init the SimDebug drawing.
A development addon can be used now to enable the debug drawing, without the need to add UI code for this in the release files. The SimDebug feature should also get an overall build flag and use function stubs unless enabled. That way any possibility of overhead in releases is eliminated.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_global.h1
-rw-r--r--source/blender/blenkernel/intern/effect.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c3
-rw-r--r--source/blender/python/intern/bpy_app.c1
4 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index e70689b4c4e..57003ffc3aa 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -126,6 +126,7 @@ enum {
G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
G_DEBUG_DEPSGRAPH = (1 << 8), /* depsgraph messages */
+ G_DEBUG_SIMDATA = (1 << 9), /* sim debug data display */
};
#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index c896fa2bbcf..9c3e78d7bb3 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -63,6 +63,7 @@
#include "BKE_DerivedMesh.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_effect.h"
+#include "BKE_global.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_particle.h"
@@ -1124,8 +1125,13 @@ void BKE_sim_debug_data_add_element(int type, const float v1[3], const float v2[
{
unsigned int category_hash = BLI_ghashutil_strhash_p(category);
SimDebugElement *elem;
- if (!_sim_debug_data)
- return;
+
+ if (!_sim_debug_data) {
+ if (G.debug & G_DEBUG_SIMDATA)
+ BKE_sim_debug_data_set_enabled(true);
+ else
+ return;
+ }
elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
elem->type = type;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index ed30c8794fd..88cabcc6763 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3584,7 +3584,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
#ifdef DEBUG_DRAW
bl_debug_draw();
#endif
- draw_sim_debug_data(scene, v3d, ar);
+ if (G.debug & G_DEBUG_SIMDATA)
+ draw_sim_debug_data(scene, v3d, ar);
ED_region_pixelspace(ar);
}
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 678fd62ae89..cca419101d3 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -283,6 +283,7 @@ static PyGetSetDef bpy_app_getsets[] = {
{(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS},
{(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM},
{(char *)"debug_depsgraph", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH},
+ {(char *)"debug_simdata", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_SIMDATA},
{(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL},
{(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL},