diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-16 18:40:05 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-16 18:40:05 +0300 |
commit | 436eea2d93b4a4b6b6b9e5b3d05c5cb01f788c83 (patch) | |
tree | 2e22317b2f37bb21a632abe440d66a3c015f41e6 /source/blender | |
parent | c810df35b235c9676be3a787a00ec6e4cacff5cb (diff) | |
parent | b55111f8f6575490b1db91c4a8a314607acf76a7 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/alembic/intern/abc_customdata.cc | 17 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_depsgraph.c | 16 |
3 files changed, 24 insertions, 11 deletions
diff --git a/source/blender/alembic/intern/abc_customdata.cc b/source/blender/alembic/intern/abc_customdata.cc index 8b526616053..b3b015c7abf 100644 --- a/source/blender/alembic/intern/abc_customdata.cc +++ b/source/blender/alembic/intern/abc_customdata.cc @@ -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); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 82bce6e346d..58b476d3da5 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -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); diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index 706fb23ab56..e6e1c714008 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -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); |