Merge branch 'master' into blender2.8

This commit is contained in:
Sergey Sharybin 2018-01-16 16:40:05 +01:00
commit 436eea2d93
3 changed files with 24 additions and 11 deletions

View File

@ -285,6 +285,7 @@ static void read_custom_data_mcols(const std::string & iobject_full_name,
{
C3fArraySamplePtr c3f_ptr = C3fArraySamplePtr();
C4fArraySamplePtr c4f_ptr = C4fArraySamplePtr();
Alembic::Abc::UInt32ArraySamplePtr indices;
bool use_c3f_ptr;
bool is_facevarying;
@ -299,6 +300,7 @@ static void read_custom_data_mcols(const std::string & iobject_full_name,
config.totloop == sample.getIndices()->size();
c3f_ptr = sample.getVals();
indices = sample.getIndices();
use_c3f_ptr = true;
}
else if (IC4fGeomParam::matches(prop_header)) {
@ -311,6 +313,7 @@ static void read_custom_data_mcols(const std::string & iobject_full_name,
config.totloop == sample.getIndices()->size();
c4f_ptr = sample.getVals();
indices = sample.getIndices();
use_c3f_ptr = false;
}
else {
@ -331,6 +334,12 @@ static void read_custom_data_mcols(const std::string & iobject_full_name,
size_t color_index;
bool bounds_warning_given = false;
/* The colors can go through two layers of indexing. Often the 'indices'
* array doesn't do anything (i.e. indices[n] = n), but when it does, it's
* important. Blender 2.79 writes indices incorrectly (see T53745), which
* is why we have to check for indices->size() > 0 */
bool use_dual_indexing = is_facevarying && indices->size() > 0;
for (int i = 0; i < config.totpoly; ++i) {
MPoly *poly = &mpolys[i];
MCol *cface = &cfaces[poly->loopstart + poly->totloop];
@ -340,9 +349,13 @@ static void read_custom_data_mcols(const std::string & iobject_full_name,
--cface;
--mloop;
color_index = is_facevarying ? face_index : mloop->v;
if (use_dual_indexing) {
color_index = (*indices)[color_index];
}
if (use_c3f_ptr) {
color_index = mcols_out_of_bounds_check(
is_facevarying ? face_index : mloop->v,
color_index,
c3f_ptr->size(),
iobject_full_name, prop_header,
bounds_warning_given);
@ -355,7 +368,7 @@ static void read_custom_data_mcols(const std::string & iobject_full_name,
}
else {
color_index = mcols_out_of_bounds_check(
is_facevarying ? face_index : mloop->v,
color_index,
c4f_ptr->size(),
iobject_full_name, prop_header,
bounds_warning_given);

View File

@ -2885,7 +2885,7 @@ void BKE_animsys_eval_animdata(const EvaluationContext *eval_ctx, ID *id)
{
AnimData *adt = BKE_animdata_from_id(id);
Scene *scene = NULL; /* XXX: this is only needed for flushing RNA updates,
* which should get handled as part of the graph instead...
* which should get handled as part of the dependency graph instead...
*/
DEBUG_PRINT("%s on %s, time=%f\n\n", __func__, id->name, (double)eval_ctx->ctime);
BKE_animsys_evaluate_animdata(scene, id, adt, eval_ctx->ctime, ADT_RECALC_ANIM);

View File

@ -120,18 +120,18 @@ static int rna_DepsgraphIter_is_instance_get(PointerRNA *ptr)
/* **************** Depsgraph **************** */
static void rna_Depsgraph_debug_relations_graphviz(Depsgraph *graph,
static void rna_Depsgraph_debug_relations_graphviz(Depsgraph *depsgraph,
const char *filename)
{
FILE *f = fopen(filename, "w");
if (f == NULL) {
return;
}
DEG_debug_relations_graphviz(graph, f, "Depsgraph");
DEG_debug_relations_graphviz(depsgraph, f, "Depsgraph");
fclose(f);
}
static void rna_Depsgraph_debug_stats_gnuplot(Depsgraph *graph,
static void rna_Depsgraph_debug_stats_gnuplot(Depsgraph *depsgraph,
const char *filename,
const char *output_filename)
{
@ -139,19 +139,19 @@ static void rna_Depsgraph_debug_stats_gnuplot(Depsgraph *graph,
if (f == NULL) {
return;
}
DEG_debug_stats_gnuplot(graph, f, "Timing Statistics", output_filename);
DEG_debug_stats_gnuplot(depsgraph, f, "Timing Statistics", output_filename);
fclose(f);
}
static void rna_Depsgraph_debug_tag_update(Depsgraph *graph)
static void rna_Depsgraph_debug_tag_update(Depsgraph *depsgraph)
{
DEG_graph_tag_relations_update(graph);
DEG_graph_tag_relations_update(depsgraph);
}
static void rna_Depsgraph_debug_stats(Depsgraph *graph, char *result)
static void rna_Depsgraph_debug_stats(Depsgraph *depsgraph, char *result)
{
size_t outer, ops, rels;
DEG_stats_simple(graph, &outer, &ops, &rels);
DEG_stats_simple(depsgraph, &outer, &ops, &rels);
BLI_snprintf(result, STATS_MAX_SIZE,
"Approx %lu Operations, %lu Relations, %lu Outer Nodes",
ops, rels, outer);