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/armature/editarmature_sketch.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/armature/editarmature_sketch.c')
-rw-r--r-- | source/blender/editors/armature/editarmature_sketch.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 4dd8e4bd6fa..f4bebfd85e0 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -929,7 +929,7 @@ static void sk_interpolateDepth(bContext *C, SK_Stroke *stk, int start, int end, float pval[2] = {0, 0}; ED_view3d_project_float_global(ar, stk->points[i].p, pval, V3D_PROJ_TEST_NOP); - ED_view3d_win_to_ray(ar, v3d, pval, ray_start, ray_normal, false); + ED_view3d_win_to_ray(CTX_data_depsgraph(C), ar, v3d, pval, ray_start, ray_normal, false); mul_v3_fl(ray_normal, distance * progress / length); add_v3_v3(stk->points[i].p, ray_normal); @@ -1486,6 +1486,7 @@ static int cmpIntersections(const void *i1, const void *i2) /* returns the maximum number of intersections per stroke */ static int sk_getIntersections(bContext *C, ListBase *list, SK_Sketch *sketch, SK_Stroke *gesture) { + const Depsgraph *depsgraph = CTX_data_depsgraph(C); ARegion *ar = CTX_wm_region(C); ScrArea *sa = CTX_wm_area(C); View3D *v3d = sa->spacedata.first; @@ -1526,7 +1527,7 @@ static int sk_getIntersections(bContext *C, ListBase *list, SK_Sketch *sketch, S mval[0] = vi[0]; mval[1] = vi[1]; - ED_view3d_win_to_segment(ar, v3d, mval, ray_start, ray_end, true); + ED_view3d_win_to_segment(depsgraph, ar, v3d, mval, ray_start, ray_end, true); isect_line_line_v3(stk->points[s_i].p, stk->points[s_i + 1].p, |