Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Werner <stefan.werner@tangent-animation.com>2018-11-23 15:08:15 +0300
committerStefan Werner <stefan.werner@tangent-animation.com>2018-11-23 15:19:53 +0300
commit071f4f4ce0b9520ab0c73d6d68365ad449ca8b80 (patch)
tree9f37bfcac669366b9ad5fb7605f2fbbed9b71b0a /source/blender/blenkernel/intern/mesh_evaluate.c
parent0a2b2d59a5897212ba3771503feb6770fb636bc8 (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_evaluate.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_evaluate.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 279ab777529..e3b1f20e583 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -569,7 +569,7 @@ void BKE_lnor_space_add_loop(
lnors_spacearr->lspacearr[ml_index] = lnor_space;
if (bm_loop == NULL) {
- bm_loop = SET_INT_IN_POINTER(ml_index);
+ bm_loop = POINTER_FROM_INT(ml_index);
}
if (is_single) {
BLI_assert(lnor_space->loops == NULL);
@@ -1658,7 +1658,7 @@ static void mesh_normals_loop_custom_set(
const float *org_nor = NULL;
while (loops) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
MLoop *ml = &mloops[lidx];
const int nidx = lidx;
float *nor = r_custom_loopnors[nidx];
@@ -1689,7 +1689,7 @@ static void mesh_normals_loop_custom_set(
* See T45984. */
loops = lnors_spacearr.lspacearr[i]->loops;
if (loops && org_nor) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
MLoop *ml = &mloops[lidx];
const int nidx = lidx;
float *nor = r_custom_loopnors[nidx];
@@ -1731,7 +1731,7 @@ static void mesh_normals_loop_custom_set(
*/
LinkNode *loops = lnors_spacearr.lspacearr[i]->loops;
if (lnors_spacearr.lspacearr[i]->flags & MLNOR_SPACE_IS_SINGLE) {
- BLI_assert(GET_INT_FROM_POINTER(loops) == i);
+ BLI_assert(POINTER_AS_INT(loops) == i);
const int nidx = use_vertices ? (int)mloops[i].v : i;
float *nor = r_custom_loopnors[nidx];
@@ -1745,7 +1745,7 @@ static void mesh_normals_loop_custom_set(
zero_v3(avg_nor);
while (loops) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
const int nidx = use_vertices ? (int)mloops[lidx].v : lidx;
float *nor = r_custom_loopnors[nidx];
@@ -2424,7 +2424,7 @@ bool BKE_mesh_center_of_volume(const Mesh *me, float r_cent[3])
}
/* otherwise we get NAN for 0 polys */
if (total_volume != 0.0f) {
- /* multipy by 0.25 to get the correct centroid */
+ /* multiply by 0.25 to get the correct centroid */
/* no need to divide volume by 6 as the centroid is weighted by 6x the volume, so it all cancels out */
mul_v3_fl(r_cent, 0.25f / total_volume);
}
@@ -3356,7 +3356,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(
/* build edge hash */
me = medge;
for (i = 0; i < totedge_i; i++, me++) {
- BLI_edgehash_insert(eh, me->v1, me->v2, SET_UINT_IN_POINTER(i));
+ BLI_edgehash_insert(eh, me->v1, me->v2, POINTER_FROM_UINT(i));
/* unrelated but avoid having the FGON flag enabled, so we can reuse it later for something else */
me->flag &= ~ME_FGON;
@@ -3378,7 +3378,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(
# define ML(v1, v2) { \
ml->v = mf->v1; \
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(eh, mf->v1, mf->v2)); \
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(eh, mf->v1, mf->v2)); \
ml++; j++; \
} (void)0