diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-18 17:58:02 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-19 13:12:22 +0300 |
commit | e46c49ff3dd67c7d759b581b677b4ab90cee3c46 (patch) | |
tree | 30164c0344ba42ca408d3b66a3a7bedccb50a150 /source/blender/editors/space_view3d/view3d_project.c | |
parent | 9cac97fb3cb2c737266bc3c8b34494fbea5ff7f2 (diff) |
Fix T53788: Camera animation not working
Both object level and camera datablock properties animation did not work with
copy on write enabled.
The root of the issue is going to the fact, that all interface elements are
referencing original datablock. For example, View3D has pointer to camera it's
using, and all areas which does access v3d->camera should in fact query for
the evaluated version of that camera, within the current context.
Annoying part of this change is that we now need to pass depsgraph in lots
of places. Which is rather annoying.
Alternative would be to cache evaluated camera in viewport itself, but then
it makes it annoying to keep things in sync.
Not sure if there is nicer solution here.
Reviewers: dfelinto, campbellbarton, mont29
Subscribers: dragoneex
Differential Revision: https://developer.blender.org/D3007
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_project.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_project.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index f8b02f0b405..af44629a18e 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -304,6 +304,7 @@ float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3], bool *r_f } static void view3d_win_to_ray_segment( + const struct Depsgraph *depsgraph, const ARegion *ar, const View3D *v3d, const float mval[2], float r_ray_co[3], float r_ray_dir[3], float r_ray_start[3], float r_ray_end[3]) { @@ -321,7 +322,7 @@ static void view3d_win_to_ray_segment( start_offset = -end_offset; } else { - ED_view3d_clip_range_get(v3d, rv3d, &start_offset, &end_offset, false); + ED_view3d_clip_range_get(depsgraph, v3d, rv3d, &start_offset, &end_offset, false); } if (r_ray_start) { @@ -360,12 +361,13 @@ bool ED_view3d_clip_segment(const RegionView3D *rv3d, float ray_start[3], float * \return success, false if the ray is totally clipped. */ bool ED_view3d_win_to_ray_ex( + const struct Depsgraph *depsgraph, const ARegion *ar, const View3D *v3d, const float mval[2], float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], bool do_clip) { float ray_end[3]; - view3d_win_to_ray_segment(ar, v3d, mval, r_ray_co, r_ray_normal, r_ray_start, ray_end); + view3d_win_to_ray_segment(depsgraph, ar, v3d, mval, r_ray_co, r_ray_normal, r_ray_start, ray_end); /* bounds clipping */ if (do_clip) { @@ -389,10 +391,11 @@ bool ED_view3d_win_to_ray_ex( * \return success, false if the ray is totally clipped. */ bool ED_view3d_win_to_ray( + const struct Depsgraph *depsgraph, const ARegion *ar, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_normal[3], const bool do_clip) { - return ED_view3d_win_to_ray_ex(ar, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip); + return ED_view3d_win_to_ray_ex(depsgraph,ar, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip); } /** @@ -622,10 +625,11 @@ void ED_view3d_win_to_vector(const ARegion *ar, const float mval[2], float out[3 * \param do_clip Optionally clip the ray by the view clipping planes. * \return success, false if the segment is totally clipped. */ -bool ED_view3d_win_to_segment(const ARegion *ar, View3D *v3d, const float mval[2], +bool ED_view3d_win_to_segment(const struct Depsgraph *depsgraph, + const ARegion *ar, View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], const bool do_clip) { - view3d_win_to_ray_segment(ar, v3d, mval, NULL, NULL, r_ray_start, r_ray_end); + view3d_win_to_ray_segment(depsgraph, ar, v3d, mval, NULL, NULL, r_ray_start, r_ray_end); /* bounds clipping */ if (do_clip) { |