Page MenuHome

Camera animation not working
Closed, ResolvedPublic

Description

System Information
OS - ubuntu 16.4 LTS with Titanx GPU

Blender Version

Blender 2.8 ( 82a94d0f848 )
camera animation not working in COW enable

in short we can not animate camera or camera's properties

Event Timeline

Philipp Oeser (lichtwerk) closed this task as Invalid.
Philipp Oeser (lichtwerk) claimed this task.

I dare to close this as this is still under development and I guess @Sergey Sharybin (sergey) is aware of this?

quoting the 2.8 guidline atm:
Thank you for the report. Currently we are aware of many issues in 2.8 and actively working to fix them. But since replying to reports takes time, we have decided to limit bug reports to [[ https://wiki.blender.org/index.php/Dev:Doc/Process/Module_Owners/List | module team ]] members.

Here is a patch which solves this bug

1diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
2index a462e5b215c..e70c64f50a6 100644
3--- a/source/blender/blenkernel/intern/scene.c
4+++ b/source/blender/blenkernel/intern/scene.c
5@@ -2194,6 +2194,13 @@ Depsgraph *BKE_scene_get_depsgraph(Scene *scene,
6 {
7 BLI_assert(scene != NULL);
8 BLI_assert(view_layer != NULL);
9+ if (scene->id.tag & LIB_TAG_COPY_ON_WRITE) {
10+ scene = (Scene *)scene->id.newid;
11+ view_layer = (ViewLayer *)BLI_findstring(
12+ &scene->view_layers,
13+ view_layer->name,
14+ offsetof(ViewLayer, name));
15+ }
16 /* Make sure hash itself exists. */
17 if (allocate) {
18 BKE_scene_ensure_depsgraph_hash(scene);
19diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
20index 36f433d5ffb..41253a166bb 100644
21--- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c
22+++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
23@@ -45,6 +45,7 @@
24 #include "BKE_screen.h"
25
26 #include "DEG_depsgraph.h"
27+#include "DEG_depsgraph_query.h"
28
29 #include "eevee_private.h"
30 #include "GPU_extensions.h"
31@@ -96,7 +97,10 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
32
33 if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
34 const float *viewport_size = DRW_viewport_size_get();
35- Camera *cam = (Camera *)v3d->camera->data;
36+ Depsgraph *depsgraph = BKE_scene_get_depsgraph(draw_ctx->scene, draw_ctx->view_layer, true);
37+ Object *camera_object_orig = v3d->camera;
38+ Object *camera_object_cow = DEG_get_evaluated_object(depsgraph, camera_object_orig);
39+ Camera *cam = camera_object_cow->data;
40
41 /* Retreive Near and Far distance */
42 effects->dof_near_far[0] = -cam->clipsta;
43@@ -145,7 +149,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
44 float rotation = cam->gpu_dof.rotation;
45 float ratio = 1.0f / cam->gpu_dof.ratio;
46 float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
47- float focus_dist = BKE_camera_object_dof_distance(v3d->camera);
48+ float focus_dist = BKE_camera_object_dof_distance(camera_object_cow);
49 float focal_len = cam->lens;
50
51 UNUSED_VARS(rotation, ratio);
52diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
53index b1140113601..5fb2969f503 100644
54--- a/source/blender/editors/space_view3d/view3d_draw.c
55+++ b/source/blender/editors/space_view3d/view3d_draw.c
56@@ -95,6 +95,9 @@
57 #include "IMB_imbuf.h"
58 #include "IMB_imbuf_types.h"
59
60+#include "DEG_depsgraph.h"
61+#include "DEG_depsgraph_query.h"
62+
63 #include "view3d_intern.h" /* own include */
64
65 /* ******************** general functions ***************** */
66@@ -120,11 +123,14 @@ static bool use_depth_doit(Scene *scene, View3D *v3d)
67 * \note keep this synced with #ED_view3d_mats_rv3d_backup/#ED_view3d_mats_rv3d_restore
68 */
69 void ED_view3d_update_viewmat(
70- const EvaluationContext *eval_ctx, Scene *scene, View3D *v3d, ARegion *ar,
71+ const EvaluationContext *eval_ctx, Scene *scene, View3D *v3d_orig, ARegion *ar,
72 float viewmat[4][4], float winmat[4][4], const rcti *rect)
73 {
74 RegionView3D *rv3d = ar->regiondata;
75
76+ View3D v3d_cow = *v3d_orig;
77+ v3d_cow.camera = DEG_get_evaluated_object(eval_ctx->depsgraph, v3d_cow.camera);
78+ View3D *v3d = &v3d_cow;
79
80 /* setup window matrices */
81 if (winmat)

The thing i don't like about it yet is that it causes a mess around what pointers are (if those are original or not etc). Will look into more streamlined approach now.

Sergey Sharybin (sergey) triaged this task as Confirmed, Medium priority.Jan 16 2018, 10:57 AM

For someone like me who doesn't know how to apply patches, is there a timeframe yet for resolving the issue in an upcoming Beta release on the blender.org page?

Use nightly builds from builder.blender.org.

Thank you. Build 2019-01-23 00:32 Hash: cd 3b5024be1a is working great this morning.

Hello again. I'm using build 2019-01-31 01:07 Hash: 8c8979067490 Branch: blender2.7 and again having all kinds of issues with camera keyframes. I set a keyframe, I move ahead several frames, move the camera (or rotate) and it snaps back to the original spot. Sometimes all the time, sometime most of the time. But regardless of the right-click options I choose to clear or set or delete keyframe, I cannot get it to work consistently correctly.

It is working using the graph editor, but the workflow makes keyframing very slow compared to the dope sheet.