When Toggling all Layers using the Tilde Key directly after a Scene Switch, the Render Camera is removed #49463

Closed
opened 2016-09-27 10:32:41 +02:00 by Rainer Trummer · 11 comments

System Information
Windows 7 x64, Quadro 4000

Blender Version
Broken: 2.77a, 2.78 any build so far

Short description of error
I've made a demo file to test. In this file there are three scenes. If you switch from Scene to Scene.001, and then directly after that hit the Tilde key (which calls bpy.ops.view3d.layers()), the active render camera is removed from the slot.

Exact steps for others to reproduce the error
Open the provided Blend, switch to Scene.001, hit Tilde. The Scene.camera property becomes None:

CameraLoss.gif

Debug_Camera_Loss.blend

**System Information** Windows 7 x64, Quadro 4000 **Blender Version** Broken: 2.77a, 2.78 any build so far **Short description of error** I've made a demo file to test. In this file there are three scenes. If you switch from Scene to Scene.001, and then directly after that hit the Tilde key (which calls bpy.ops.view3d.layers()), the active render camera is removed from the slot. **Exact steps for others to reproduce the error** Open the provided Blend, switch to Scene.001, hit Tilde. The Scene.camera property becomes None: ![CameraLoss.gif](https://archive.blender.org/developer/F369159/CameraLoss.gif) [Debug_Camera_Loss.blend](https://archive.blender.org/developer/F369161/Debug_Camera_Loss.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @RainerTrummer

Added subscriber: @RainerTrummer

Added subscriber: @Sergey

Added subscriber: @Sergey

Can confirm the issue, but not sure yet what's going on.

Can confirm the issue, but not sure yet what's going on.
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Main reason this happens is because the camera for Scene.001 is coming from a different scene. This is generally supported and I don't see any issues with it, so don't think we should prevent this.

Would propose this fix: P404: Possible fix for #49463

diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 0713377..d960992 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -68,8 +68,10 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event);
 #define B_SEL_EDGE  111
 #define B_SEL_FACE  112
 
-/* XXX quickly ported across */
-static void handle_view3d_lock(bContext *C)
+/**
+ * If needed, sync scene with changed 3D view layers and update all 3D views for changed scene data.
+ */
+static void view3d_layers_update(bContext *C)
 {
        Main *bmain = CTX_data_main(C);
        Scene *scene = CTX_data_scene(C);
@@ -81,7 +83,6 @@ static void handle_view3d_lock(bContext *C)
                        /* copy to scene */
                        scene->lay = v3d->lay;
                        scene->layact = v3d->layact;
-                       scene->camera = v3d->camera;
 
                        /* not through notifier, listener don't have context
                         * and non-open screens or spaces need to be updated too */
@@ -170,7 +171,7 @@ static int view3d_layers_exec(bContext *C, wmOperator *op)
                }
        }
        
-       if (v3d->scenelock) handle_view3d_lock(C);
+       if (v3d->scenelock) view3d_layers_update(C);
        
        DAG_on_visible_update(CTX_data_main(C), false);
 

Really don't see why you'd update scene camera when changing 3D view layers... probably this function used to be called after changing 3D View camera.

Main reason this happens is because the camera for Scene.001 is coming from a different scene. This is generally supported and I don't see any issues with it, so don't think we should prevent this. Would propose this fix: [P404: Possible fix for #49463](https://archive.blender.org/developer/P404.txt) ```diff diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 0713377..d960992 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -68,8 +68,10 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event); #define B_SEL_EDGE 111 #define B_SEL_FACE 112 -/* XXX quickly ported across */ -static void handle_view3d_lock(bContext *C) +/** + * If needed, sync scene with changed 3D view layers and update all 3D views for changed scene data. + */ +static void view3d_layers_update(bContext *C) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -81,7 +83,6 @@ static void handle_view3d_lock(bContext *C) /* copy to scene */ scene->lay = v3d->lay; scene->layact = v3d->layact; - scene->camera = v3d->camera; /* not through notifier, listener don't have context * and non-open screens or spaces need to be updated too */ @@ -170,7 +171,7 @@ static int view3d_layers_exec(bContext *C, wmOperator *op) } } - if (v3d->scenelock) handle_view3d_lock(C); + if (v3d->scenelock) view3d_layers_update(C); DAG_on_visible_update(CTX_data_main(C), false); ``` Really don't see why you'd update scene camera when changing 3D view layers... probably this function used to be called after changing 3D View camera.
Author

@JulianEisel I tried to apply this as a patch today, but it failed for me (didn't find the lines to change). To I need to target a specific commit to make it work?

@JulianEisel I tried to apply this as a patch today, but it failed for me (didn't find the lines to change). To I need to target a specific commit to make it work?

Added subscriber: @AnthonyEdlin

Added subscriber: @AnthonyEdlin
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Philipp Oeser self-assigned this 2019-10-10 10:15:54 +02:00
Member

Looks like this is not relevant for 2.8 anymore?

Will close this one, please reopen if issues persist....

Looks like this is not relevant for 2.8 anymore? Will close this one, please reopen if issues persist....
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
5 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#49463
No description provided.