Merge branch 'master' into blender2.8

This commit is contained in:
Sergey Sharybin 2018-02-22 10:47:40 +01:00
commit 6bac7c35e8
6 changed files with 55 additions and 63 deletions

View File

@ -283,7 +283,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);
@ -300,7 +300,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

@ -32,16 +32,12 @@
#include "MEM_guardedalloc.h"
// #define DEBUG_TIME
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#ifdef DEBUG_TIME
# include "PIL_time.h"
# include "PIL_time_utildefines.h"
#endif
#include "PIL_time.h"
#include "PIL_time_utildefines.h"
extern "C" {
#include "DNA_cachefile_types.h"
@ -202,9 +198,10 @@ void DEG_graph_build_from_view_layer(Depsgraph *graph,
Scene *scene,
ViewLayer *view_layer)
{
#ifdef DEBUG_TIME
TIMEIT_START(DEG_graph_build_from_view_layer);
#endif
double start_time;
if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) {
start_time = PIL_check_seconds_timer();
}
DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph);
BLI_assert(BLI_findindex(&scene->view_layers, view_layer) != -1);
@ -257,16 +254,17 @@ void DEG_graph_build_from_view_layer(Depsgraph *graph,
}
#endif
#ifdef DEBUG_TIME
TIMEIT_END(DEG_graph_build_from_view_layer);
#endif
/* Relations are up to date. */
deg_graph->need_update = false;
if (need_on_visible_update) {
DEG_graph_on_visible_update(bmain, graph);
}
if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) {
printf("Depsgraph built in %f seconds.\n",
PIL_check_seconds_timer() - start_time);
}
}
/* Tag graph relations for update. */
@ -293,7 +291,7 @@ void DEG_graph_relations_update(Depsgraph *graph,
/* Tag all relations for update. */
void DEG_relations_tag_update(Main *bmain)
{
DEG_DEBUG_PRINTF("%s: Tagging relations for update.\n", __func__);
DEG_DEBUG_PRINTF(TAG, "%s: Tagging relations for update.\n", __func__);
LISTBASE_FOREACH (Scene *, scene, &bmain->scene) {
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
Depsgraph *depsgraph =
@ -341,45 +339,40 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle,
const char *name)
{
ListBase *effectors = pdInitEffectors(NULL, scene, object, NULL, effector_weights, false);
if (effectors) {
for (EffectorCache *eff = (EffectorCache*)effectors->first; eff; eff = eff->next) {
if (eff->ob != object && eff->pd->forcefield != skip_forcefield) {
DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_TRANSFORM, name);
if (eff->psys) {
DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_EVAL_PARTICLES, name);
/* TODO: remove this when/if EVAL_PARTICLES is sufficient
* for up to date particles.
*/
DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_GEOMETRY, name);
}
if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) {
DEG_add_object_relation(handle,
eff->pd->f_source,
DEG_OB_COMP_TRANSFORM,
"Smoke Force Domain");
DEG_add_object_relation(handle,
eff->pd->f_source,
DEG_OB_COMP_GEOMETRY,
"Smoke Force Domain");
}
if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) {
DEG_add_collision_relations(handle,
scene,
object,
NULL,
eModifierType_Collision,
NULL,
true,
"Force Absorption");
}
if (effectors == NULL) {
return;
}
for (EffectorCache *eff = (EffectorCache*)effectors->first; eff; eff = eff->next) {
if (eff->ob != object && eff->pd->forcefield != skip_forcefield) {
DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_TRANSFORM, name);
if (eff->psys) {
DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_EVAL_PARTICLES, name);
/* TODO: remove this when/if EVAL_PARTICLES is sufficient
* for up to date particles.
*/
DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_GEOMETRY, name);
}
if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) {
DEG_add_object_relation(handle,
eff->pd->f_source,
DEG_OB_COMP_TRANSFORM,
"Smoke Force Domain");
DEG_add_object_relation(handle,
eff->pd->f_source,
DEG_OB_COMP_GEOMETRY,
"Smoke Force Domain");
}
if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) {
DEG_add_collision_relations(handle,
scene,
object,
NULL,
eModifierType_Collision,
NULL,
true,
"Force Absorption");
}
}
}
pdEndEffectors(&effectors);
}

View File

@ -112,12 +112,11 @@ void deg_editors_id_update(const DEGEditorUpdateContext *update_ctx,
void deg_editors_scene_update(const DEGEditorUpdateContext *update_ctx,
bool updated);
#define DEG_DEBUG_PRINTF(...) \
do { \
if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) { \
fprintf(stderr, __VA_ARGS__); \
fflush(stderr); \
} \
#define DEG_DEBUG_PRINTF(type, ...) \
do { \
if (G.debug & G_DEBUG_DEPSGRAPH_ ## type) { \
fprintf(stderr, __VA_ARGS__); \
} \
} while (0)
#define DEG_ERROR_PRINTF(...) \

View File

@ -248,7 +248,7 @@ void flush_editors_id_update(Main *bmain,
id_cow->recalc |= factory->id_recalc_tag();
}
GHASH_FOREACH_END();
DEG_DEBUG_PRINTF("Accumulated recalc bits for %s: %u\n",
DEG_DEBUG_PRINTF(EVAL, "Accumulated recalc bits for %s: %u\n",
id_orig->name, (unsigned int)id_cow->recalc);
/* Inform editors. */
if (deg_copy_on_write_is_expanded(id_cow)) {