[Bf-blender-cvs] [d2d92442300] greasepencil-object: Add more control for debug lines
Antonio Vazquez
noreply at git.blender.org
Fri May 19 16:48:58 CEST 2017
Commit: d2d924423008476ccfbccb52069d341f54f20d31
Author: Antonio Vazquez
Date: Fri May 19 15:47:19 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd2d924423008476ccfbccb52069d341f54f20d31
Add more control for debug lines
Now the debug lines are only visible when code is 668
===================================================================
M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M source/blender/draw/engines/gpencil/gpencil_engine.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 53488341e03..87d647de156 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -98,8 +98,8 @@ static void gpencil_batch_cache_check_free_slots(bGPdata *gpd)
/* cache init */
static void gpencil_batch_cache_init(bGPdata *gpd, int cfra)
{
- if (G.debug & G_DEBUG) {
- printf("GPencil_Cache init for %s\n", gpd->id.name);
+ if (G.debug_value == 668) {
+ printf("gpencil_batch_cache_init for %s\n", gpd->id.name);
}
GpencilBatchCache *cache = gpd->batch_cache;
@@ -133,8 +133,8 @@ void gpencil_batch_cache_clear(bGPdata *gpd)
if (gpd->flag & GP_DATA_CACHE_IS_DIRTY) {
return;
}
- if (G.debug & G_DEBUG) {
- printf("GPencil_Cache clear for %s\n", gpd->id.name);
+ if (G.debug_value == 668) {
+ printf("gpencil_batch_cache_clear for %s\n", gpd->id.name);
}
if (cache->cache_size > 0) {
@@ -542,8 +542,8 @@ static void gpencil_draw_onionskins(GpencilBatchCache *cache, GPENCIL_e_data *e_
/* helper for populate a complete grease pencil datablock */
void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene *scene, Object *ob, ToolSettings *ts, bGPdata *gpd)
{
- if (G.debug & G_DEBUG) {
- printf("GPencil_Cache populate for %s\n", gpd->id.name);
+ if (G.debug_value == 668) {
+ printf("DRW_gpencil_populate_datablock for %s\n", gpd->id.name);
}
GpencilBatchCache *cache = gpencil_batch_cache_get(gpd, CFRA);
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index b886cbb6917..64192b09633 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -27,6 +27,7 @@
#include "DRW_render.h"
#include "BKE_main.h"
+#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_image.h"
#include "ED_gpencil.h"
@@ -105,6 +106,10 @@ static void GPENCIL_engine_free(void)
static void GPENCIL_cache_init(void *vedata)
{
+ if (G.debug_value == 668) {
+ printf("GPENCIL_cache_init\n");
+ }
+
GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
@@ -150,18 +155,28 @@ static void GPENCIL_cache_populate(void *vedata, Object *ob)
if (stl->g_data->scene_draw == false) {
stl->g_data->scene_draw = true;
if (scene && scene->gpd) {
+ if (G.debug_value == 668) {
+ printf("GPENCIL_cache_populate: Scene\n");
+ }
DRW_gpencil_populate_datablock(&e_data, vedata, scene, NULL, ts, scene->gpd);
}
}
/* object datablock */
if (ob->type == OB_GPENCIL && ob->gpd) {
+ if (G.debug_value == 668) {
+ printf("GPENCIL_cache_populate: Object\n");
+ }
DRW_gpencil_populate_datablock(&e_data, vedata, scene, ob, ts, ob->gpd);
}
}
static void GPENCIL_cache_finish(void *vedata)
{
+ if (G.debug_value == 668) {
+ printf("GPENCIL_cache_finish\n");
+ }
+
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
stl->g_data->scene_draw = false;
}
More information about the Bf-blender-cvs
mailing list