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/editors/space_clip/clip_ops.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/editors/space_clip/clip_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 4754d45a0d1..1d9669e3e97 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -113,12 +113,16 @@ static void sclip_zoom_set(const bContext *C, float zoom, float location[2]) } if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) { - float dx, dy; + float aspx, aspy, w, h, dx, dy; ED_space_clip_get_size(sc, &width, &height); + ED_space_clip_get_aspect(sc, &aspx, &aspy); - dx = ((location[0] - 0.5f) * width - sc->xof) * (sc->zoom - oldzoom) / sc->zoom; - dy = ((location[1] - 0.5f) * height - sc->yof) * (sc->zoom - oldzoom) / sc->zoom; + w = width * aspx; + h = height * aspy; + + dx = ((location[0] - 0.5f) * w - sc->xof) * (sc->zoom - oldzoom) / sc->zoom; + dy = ((location[1] - 0.5f) * h - sc->yof) * (sc->zoom - oldzoom) / sc->zoom; if (sc->flag & SC_LOCK_SELECTION) { sc->xlockof += dx; @@ -1585,7 +1589,7 @@ void CLIP_OT_cursor_set(wmOperatorType *ot) "Cursor location in normalized clip coordinates", -10.0f, 10.0f); } -/********************** macroses *********************/ +/********************** macros *********************/ void ED_operatormacros_clip(void) { |