Camera animation not working #53788

Closed
opened 2018-01-15 13:41:14 +01:00 by pratik solanki · 17 comments

System Information
OS - ubuntu 16.4 LTS with Titanx GPU

Blender Version

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

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

**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
Author

Added subscriber: @pratiksolanki

Added subscriber: @pratiksolanki
Member

Added subscribers: @Sergey, @lichtwerk

Added subscribers: @Sergey, @lichtwerk
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Philipp Oeser self-assigned this 2018-01-15 16:40:03 +01:00
Member

I dare to close this as this is still under development and I guess @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 [module team ](https://wiki.blender.org/index.php/Dev:Doc/Process/Module_Owners/List) members.

I dare to close this as this is still under development and I guess @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 [module team ](https://wiki.blender.org/index.php/Dev:Doc/Process/Module_Owners/List) members.`
Philipp Oeser removed their assignment 2018-01-15 16:42:59 +01:00
Sergey Sharybin was assigned by Philipp Oeser 2018-01-15 16:42:59 +01:00
Member

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'
Member

after talking to @Sergey in IRC: assigning to him...

after talking to @Sergey in IRC: assigning to him...

Here is a patch which solves this bug

P590: Inspiration fix for #53788

diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index a462e5b215c..e70c64f50a6 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -2194,6 +2194,13 @@ Depsgraph *BKE_scene_get_depsgraph(Scene *scene,
 {
 	BLI_assert(scene != NULL);
 	BLI_assert(view_layer != NULL);
+	if (scene->id.tag & LIB_TAG_COPY_ON_WRITE) {
+		scene = (Scene *)scene->id.newid;
+		view_layer = (ViewLayer *)BLI_findstring(
+		        &scene->view_layers,
+		        view_layer->name,
+		        offsetof(ViewLayer, name));
+	}
 	/* Make sure hash itself exists. */
 	if (allocate) {
 		BKE_scene_ensure_depsgraph_hash(scene);
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
index 36f433d5ffb..41253a166bb 100644
--- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c
+++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
@@ -45,6 +45,7 @@
 #include "BKE_screen.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
 
 #include "eevee_private.h"
 #include "GPU_extensions.h"
@@ -96,7 +97,10 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
 
 		if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
 			const float *viewport_size = DRW_viewport_size_get();
-			Camera *cam = (Camera *)v3d->camera->data;
+			Depsgraph *depsgraph = BKE_scene_get_depsgraph(draw_ctx->scene, draw_ctx->view_layer, true);
+			Object *camera_object_orig = v3d->camera;
+			Object *camera_object_cow = DEG_get_evaluated_object(depsgraph, camera_object_orig);
+			Camera *cam = camera_object_cow->data;
 
 			/* Retreive Near and Far distance */
 			effects->dof_near_far- [x] = -cam->clipsta;
@@ -145,7 +149,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
 			float rotation = cam->gpu_dof.rotation;
 			float ratio = 1.0f / cam->gpu_dof.ratio;
 			float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
-			float focus_dist = BKE_camera_object_dof_distance(v3d->camera);
+			float focus_dist = BKE_camera_object_dof_distance(camera_object_cow);
 			float focal_len = cam->lens;
 
 			UNUSED_VARS(rotation, ratio);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index b1140113601..5fb2969f503 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -95,6 +95,9 @@
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
 
+#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
+
 #include "view3d_intern.h"  /* own include */
 
 /* ******************** general functions ***************** */
@@ -120,11 +123,14 @@ static bool use_depth_doit(Scene *scene, View3D *v3d)
  * \note keep this synced with #ED_view3d_mats_rv3d_backup/#ED_view3d_mats_rv3d_restore
  */
 void ED_view3d_update_viewmat(
-        const EvaluationContext *eval_ctx, Scene *scene, View3D *v3d, ARegion *ar,
+        const EvaluationContext *eval_ctx, Scene *scene, View3D *v3d_orig, ARegion *ar,
         float viewmat- [x]- [x], float winmat- [x]- [x], const rcti *rect)
 {
 	RegionView3D *rv3d = ar->regiondata;
 
+	View3D v3d_cow = *v3d_orig;
+	v3d_cow.camera = DEG_get_evaluated_object(eval_ctx->depsgraph, v3d_cow.camera);
+	View3D *v3d = &v3d_cow;
 
 	/* setup window matrices */
 	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.

Here is a patch which solves this bug [P590: Inspiration fix for #53788](https://archive.blender.org/developer/P590.txt) ``` diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index a462e5b215c..e70c64f50a6 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2194,6 +2194,13 @@ Depsgraph *BKE_scene_get_depsgraph(Scene *scene, { BLI_assert(scene != NULL); BLI_assert(view_layer != NULL); + if (scene->id.tag & LIB_TAG_COPY_ON_WRITE) { + scene = (Scene *)scene->id.newid; + view_layer = (ViewLayer *)BLI_findstring( + &scene->view_layers, + view_layer->name, + offsetof(ViewLayer, name)); + } /* Make sure hash itself exists. */ if (allocate) { BKE_scene_ensure_depsgraph_hash(scene); diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 36f433d5ffb..41253a166bb 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -45,6 +45,7 @@ #include "BKE_screen.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "eevee_private.h" #include "GPU_extensions.h" @@ -96,7 +97,10 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v if (rv3d->persp == RV3D_CAMOB && v3d->camera) { const float *viewport_size = DRW_viewport_size_get(); - Camera *cam = (Camera *)v3d->camera->data; + Depsgraph *depsgraph = BKE_scene_get_depsgraph(draw_ctx->scene, draw_ctx->view_layer, true); + Object *camera_object_orig = v3d->camera; + Object *camera_object_cow = DEG_get_evaluated_object(depsgraph, camera_object_orig); + Camera *cam = camera_object_cow->data; /* Retreive Near and Far distance */ effects->dof_near_far- [x] = -cam->clipsta; @@ -145,7 +149,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v float rotation = cam->gpu_dof.rotation; float ratio = 1.0f / cam->gpu_dof.ratio; float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); - float focus_dist = BKE_camera_object_dof_distance(v3d->camera); + float focus_dist = BKE_camera_object_dof_distance(camera_object_cow); float focal_len = cam->lens; UNUSED_VARS(rotation, ratio); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index b1140113601..5fb2969f503 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -95,6 +95,9 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" + #include "view3d_intern.h" /* own include */ /* ******************** general functions ***************** */ @@ -120,11 +123,14 @@ static bool use_depth_doit(Scene *scene, View3D *v3d) * \note keep this synced with #ED_view3d_mats_rv3d_backup/#ED_view3d_mats_rv3d_restore */ void ED_view3d_update_viewmat( - const EvaluationContext *eval_ctx, Scene *scene, View3D *v3d, ARegion *ar, + const EvaluationContext *eval_ctx, Scene *scene, View3D *v3d_orig, ARegion *ar, float viewmat- [x]- [x], float winmat- [x]- [x], const rcti *rect) { RegionView3D *rv3d = ar->regiondata; + View3D v3d_cow = *v3d_orig; + v3d_cow.camera = DEG_get_evaluated_object(eval_ctx->depsgraph, v3d_cow.camera); + View3D *v3d = &v3d_cow; /* setup window matrices */ 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.

This issue was referenced by e46c49ff3d

This issue was referenced by e46c49ff3dd67c7d759b581b677b4ab90cee3c46

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Added subscriber: @JaySchay

Added subscriber: @JaySchay

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?

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.

Use nightly builds from builder.blender.org.

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

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: 8c89790674 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.removing from fridge.blend

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.[removing from fridge.blend](https://archive.blender.org/developer/F6467365/removing_from_fridge.blend)

Added subscriber: @brecht

Added subscriber: @brecht

Tomorrow's build will have some fixes that are likely to help with that: 83f8f44791.

Tomorrow's build will have some fixes that are likely to help with that: 83f8f44791.

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

It is working using the graph editor, but the workflow makes keyframing very slow compared to the dope sheet.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#53788
No description provided.