Depsgraph: Use proper debug print flags check

Was printing some tagging/evaluation prints when only building
messages were requested.
This commit is contained in:
Sergey Sharybin 2018-02-22 10:40:18 +01:00
parent 9729726aa8
commit 51483bd49f
6 changed files with 9 additions and 9 deletions

View File

@ -282,7 +282,7 @@ void DepsgraphRelationBuilder::add_time_relation(TimeSourceDepsNode *timesrc,
graph_->add_new_relation(timesrc, node_to, description, check_unique);
}
else {
DEG_DEBUG_PRINTF("add_time_relation(%p = %s, %p = %s, %s) Failed\n",
DEG_DEBUG_PRINTF(BUILD, "add_time_relation(%p = %s, %p = %s, %s) Failed\n",
timesrc, (timesrc) ? timesrc->identifier().c_str() : "<None>",
node_to, (node_to) ? node_to->identifier().c_str() : "<None>",
description);
@ -299,7 +299,7 @@ void DepsgraphRelationBuilder::add_operation_relation(
graph_->add_new_relation(node_from, node_to, description, check_unique);
}
else {
DEG_DEBUG_PRINTF("add_operation_relation(%p = %s, %p = %s, %s) Failed\n",
DEG_DEBUG_PRINTF(BUILD, "add_operation_relation(%p = %s, %p = %s, %s) Failed\n",
node_from, (node_from) ? node_from->identifier().c_str() : "<None>",
node_to, (node_to) ? node_to->identifier().c_str() : "<None>",
description);

View File

@ -175,7 +175,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *object,
}
}
DEG_DEBUG_PRINTF("\nStarting IK Build: pchan = %s, target = (%s, %s), segcount = %d\n",
DEG_DEBUG_PRINTF(BUILD, "\nStarting IK Build: pchan = %s, target = (%s, %s), segcount = %d\n",
pchan->name, data->tar->id.name, data->subtarget, data->rootbone);
bPoseChannel *parchan = pchan;
@ -218,7 +218,7 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *object,
root_map->add_bone(parchan->name, rootchan->name);
/* continue up chain, until we reach target number of items... */
DEG_DEBUG_PRINTF(" %d = %s\n", segcount, parchan->name);
DEG_DEBUG_PRINTF(BUILD, " %d = %s\n", segcount, parchan->name);
segcount++;
if ((segcount == data->rootbone) || (segcount > 255)) break; /* 255 is weak */

View File

@ -117,7 +117,7 @@ void deg_graph_transitive_reduction(Depsgraph *graph)
}
}
}
DEG_DEBUG_PRINTF("Removed %d relations\n", num_removed_relations);
DEG_DEBUG_PRINTF(BUILD, "Removed %d relations\n", num_removed_relations);
}
} // namespace DEG

View File

@ -109,9 +109,9 @@ void deg_editors_id_update(struct Main *bmain, struct ID *id);
void deg_editors_scene_update(struct Main *bmain, struct Scene *scene, bool updated);
#define DEG_DEBUG_PRINTF(...) \
#define DEG_DEBUG_PRINTF(type, ...) \
do { \
if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) { \
if (G.debug & G_DEBUG_DEPSGRAPH_ ## type) { \
fprintf(stderr, __VA_ARGS__); \
} \
} while (0)

View File

@ -180,7 +180,7 @@ void DEG_id_tag_update_ex(Main *bmain, ID *id, short flag)
/* Ideally should not happen, but old depsgraph allowed this. */
return;
}
DEG_DEBUG_PRINTF("%s: id=%s flag=%d\n", __func__, id->name, flag);
DEG_DEBUG_PRINTF(TAG, "%s: id=%s flag=%d\n", __func__, id->name, flag);
lib_id_recalc_tag_flag(bmain, id, flag);
for (Scene *scene = (Scene *)bmain->scene.first;
scene != NULL;

View File

@ -256,7 +256,7 @@ void deg_evaluate_on_refresh(EvaluationContext *eval_ctx,
if (BLI_gset_len(graph->entry_tags) == 0) {
return;
}
DEG_DEBUG_PRINTF("%s: layers:%u, graph->layers:%u\n",
DEG_DEBUG_PRINTF(EVAL, "%s: layers:%u, graph->layers:%u\n",
__func__,
layers,
graph->layers);