diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-11-23 15:08:15 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-11-23 15:19:53 +0300 |
commit | 071f4f4ce0b9520ab0c73d6d68365ad449ca8b80 (patch) | |
tree | 9f37bfcac669366b9ad5fb7605f2fbbed9b71b0a /source/blender/blenkernel/intern/mesh_validate.c | |
parent | 0a2b2d59a5897212ba3771503feb6770fb636bc8 (diff) |
Cycles: Improved robustness of hair motion blur.motion_curve_fix
In some instances, the number of control vertices of a hair could change mid-frame.
Cycles would then be unable to calculate proper motion blur for those hairs. This adds
interpolated CVs to fill in for the missing data. While this will not necessarily result in
a fully accurate reconstruction of the guide hair, it preserves motion blur instead of disabling it.
Reviewers: #cycles, sergey
Reviewed By: #cycles, sergey
Subscribers: sergey, brecht, #cycles
Tags: #cycles
Differential Revision: https://developer.blender.org/D3695
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_validate.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_validate.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index 5c835bbf0fa..82b3edb5b49 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -326,13 +326,13 @@ bool BKE_mesh_validate_arrays( if ((me->v1 != me->v2) && BLI_edgehash_haskey(edge_hash, me->v1, me->v2)) { PRINT_ERR("\tEdge %u: is a duplicate of %d\n", i, - GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, me->v1, me->v2))); + POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, me->v1, me->v2))); remove = do_fixes; } if (remove == false) { if (me->v1 != me->v2) { - BLI_edgehash_insert(edge_hash, me->v1, me->v2, SET_INT_IN_POINTER(i)); + BLI_edgehash_insert(edge_hash, me->v1, me->v2, POINTER_FROM_INT(i)); } } else { @@ -362,7 +362,7 @@ bool BKE_mesh_validate_arrays( SortFace *sf_prev; unsigned int totsortface = 0; - PRINT_ERR("No Polys, only tesselated Faces\n"); + PRINT_ERR("No Polys, only tessellated Faces\n"); for (i = 0, mf = mfaces, sf = sort_faces; i < totface; i++, mf++) { bool remove = false; @@ -566,7 +566,7 @@ bool BKE_mesh_validate_arrays( * We already know from previous text that a valid edge exists, use it (if allowed)! */ if (do_fixes) { int prev_e = ml->e; - ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2)); + ml->e = POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, v1, v2)); fix_flag.loops_edge = true; PRINT_ERR("\tLoop %u has invalid edge reference (%d), fixed using edge %u\n", sp->loopstart + j, prev_e, ml->e); @@ -583,7 +583,7 @@ bool BKE_mesh_validate_arrays( * and we already know from previous test that a valid one exists, use it (if allowed)! */ if (do_fixes) { int prev_e = ml->e; - ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2)); + ml->e = POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, v1, v2)); fix_flag.loops_edge = true; PRINT_ERR("\tPoly %u has invalid edge reference (%d, is_removed: %d), fixed using edge %u\n", sp->index, prev_e, IS_REMOVED_EDGE(me), ml->e); @@ -1390,7 +1390,7 @@ static void mesh_calc_edges_mdata( /* set edge members of mloops */ hash = BLI_edgehash_new_ex(__func__, totedge_final); for (edge_index = 0, med = medge; edge_index < totedge_final; edge_index++, med++) { - BLI_edgehash_insert(hash, med->v1, med->v2, SET_UINT_IN_POINTER(edge_index)); + BLI_edgehash_insert(hash, med->v1, med->v2, POINTER_FROM_UINT(edge_index)); } mpoly = allpoly; @@ -1402,7 +1402,7 @@ static void mesh_calc_edges_mdata( ml = &ml_next[i - 1]; /* last loop */ while (i-- != 0) { - ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(hash, ml->v, ml_next->v)); + ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(hash, ml->v, ml_next->v)); ml = ml_next; ml_next++; } @@ -1511,7 +1511,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select) } /* store the new edge index in the hash value */ - BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(i)); + BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(i)); } BLI_edgehashIterator_free(ehi); @@ -1524,7 +1524,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select) int j; for (j = 0; j < mp->totloop; j++, l++) { /* lookup hashed edge index */ - med_index = GET_INT_FROM_POINTER(BLI_edgehash_lookup(eh, l_prev->v, l->v)); + med_index = POINTER_AS_INT(BLI_edgehash_lookup(eh, l_prev->v, l->v)); l_prev->e = med_index; l_prev = l; } |