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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-01-18 17:58:02 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-01-19 13:12:22 +0300
commite46c49ff3dd67c7d759b581b677b4ab90cee3c46 (patch)
tree30164c0344ba42ca408d3b66a3a7bedccb50a150 /source/blender/editors/manipulator_library
parent9cac97fb3cb2c737266bc3c8b34494fbea5ff7f2 (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/manipulator_library')
-rw-r--r--source/blender/editors/manipulator_library/manipulator_library_utils.c2
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c1
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c6
3 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/manipulator_library/manipulator_library_utils.c b/source/blender/editors/manipulator_library/manipulator_library_utils.c
index 38b518b1992..12f9d1b48d3 100644
--- a/source/blender/editors/manipulator_library/manipulator_library_utils.c
+++ b/source/blender/editors/manipulator_library/manipulator_library_utils.c
@@ -195,7 +195,7 @@ bool manipulator_window_project_2d(
float ray_origin[3], ray_direction[3];
- if (ED_view3d_win_to_ray(ar, v3d, mval, ray_origin, ray_direction, false)) {
+ if (ED_view3d_win_to_ray(CTX_data_depsgraph(C), ar, v3d, mval, ray_origin, ray_direction, false)) {
float lambda;
if (isect_ray_plane_v3(ray_origin, ray_direction, plane, &lambda, true)) {
float co[3];
diff --git a/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
index 9291d5de125..cc8fd72aa03 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
@@ -262,6 +262,7 @@ static int manipulator_arrow_modal(
for (int j = 0; j < 2; j++) {
if (ED_view3d_win_to_ray(
+ CTX_data_depsgraph(C),
ar, v3d, proj[j].mval,
proj[j].ray_origin, proj[j].ray_direction, false))
{
diff --git a/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
index f2f5851ff0c..2991c972f6e 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
@@ -191,6 +191,7 @@ static void dial_ghostarc_draw(
}
static void dial_ghostarc_get_angles(
+ const struct Depsgraph *depsgraph,
const wmManipulator *mpr,
const wmEvent *event,
const ARegion *ar, const View3D *v3d,
@@ -218,7 +219,7 @@ static void dial_ghostarc_get_angles(
plane_from_point_normal_v3(dial_plane, mpr->matrix_basis[3], axis_vec);
- if (!ED_view3d_win_to_ray(ar, v3d, inter->init_mval, ray_co, ray_no, false) ||
+ if (!ED_view3d_win_to_ray(depsgraph, ar, v3d, inter->init_mval, ray_co, ray_no, false) ||
!isect_ray_plane_v3(ray_co, ray_no, dial_plane, &ray_lambda, false))
{
goto fail;
@@ -226,7 +227,7 @@ static void dial_ghostarc_get_angles(
madd_v3_v3v3fl(proj_mval_init_rel, ray_co, ray_no, ray_lambda);
sub_v3_v3(proj_mval_init_rel, mpr->matrix_basis[3]);
- if (!ED_view3d_win_to_ray(ar, v3d, mval, ray_co, ray_no, false) ||
+ if (!ED_view3d_win_to_ray(depsgraph, ar, v3d, mval, ray_co, ray_no, false) ||
!isect_ray_plane_v3(ray_co, ray_no, dial_plane, &ray_lambda, false))
{
goto fail;
@@ -396,6 +397,7 @@ static int manipulator_dial_modal(
dial_calc_matrix(mpr, matrix);
dial_ghostarc_get_angles(
+ CTX_data_depsgraph(C),
mpr, event, CTX_wm_region(C), CTX_wm_view3d(C), matrix, co_outer, &angle_ofs, &angle_delta);
DialInteraction *inter = mpr->interaction_data;