No undo when moving viewport with camera locked to view #92099

Closed
opened 2021-10-11 01:41:24 +02:00 by stib · 22 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: Quadro P5000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.12

Blender Version
Broken: version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: a791bdabd0
Worked: (newest version of Blender that worked as expected)

Short description of error
When the camera is locked to the viewport, moving the viewport with the MMB moves the camera, as expected. However there is no undo if the user accidentally moves the viewport (which happens all the time).

Exact steps for others to reproduce the error
in the N side-menu check view>Lock>Camera to View
hit 0 to enter camera view in a 3D viewport
rotate the view with the MMB
Undo
Expected: camera goes back to default position
Observed: camera stays in niew position

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: Quadro P5000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.12 **Blender Version** Broken: version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: `a791bdabd0` Worked: (newest version of Blender that worked as expected) **Short description of error** When the camera is locked to the viewport, moving the viewport with the MMB moves the camera, as expected. However there is no undo if the user accidentally moves the viewport (which happens all the time). **Exact steps for others to reproduce the error** in the N side-menu check view>Lock>Camera to View hit 0 to enter camera view in a 3D viewport rotate the view with the MMB Undo Expected: camera goes back to default position Observed: camera stays in niew position
Author

Added subscriber: @stibbot

Added subscriber: @stibbot

#71435 was marked as duplicate of this issue

#71435 was marked as duplicate of this issue
Member

Added subscriber: @kursadk

Added subscriber: @kursadk
Member

I can confirm this as well, sometimes the camerta undo is possible and sometimes it is not possible.

I can confirm this as well, sometimes the camerta undo is possible and sometimes it is not possible.
Member

Added subscribers: @JulianEisel, @mont29, @lichtwerk

Added subscribers: @JulianEisel, @mont29, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Quick talk to @JulianEisel and @mont29 and (even though an edge case), can be confirmed, yes.

Quick talk to @JulianEisel and @mont29 and (even though an edge case), can be confirmed, yes.

Added subscriber: @MrBeep

Added subscriber: @MrBeep

Same in 3.0 released on december 03 2021. Undo does not work when camera was moved with mouse or works as described in original post.

Same in 3.0 released on december 03 2021. Undo does not work when camera was moved with mouse or works as described in original post.
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123

Added subscriber: @Max-49

Added subscriber: @Max-49
Pratik Borhade self-assigned this 2022-07-02 08:11:31 +02:00
Member

Added subscriber: @JulienKaspar

Added subscriber: @JulienKaspar
Member
Added subscribers: @popqjp, @dr.sybren, @BassamKurdali, @momoSnack, @mano-wii
Member

In #71435#1284453, @lichtwerk wrote:
Lets put it that way: Should there be an undo push? Yes or No?
I can see both behaviors be somewhat problematic.
If we add an undo push here, we'll get many undo steps by view rotation (possibly also leading to unwanted behavior when working with operators).
Or is the user expected to not use Camera to View in that case?

Might be related to @BassamKurdali mentioning that autokey is not working in that scenario in https://devtalk.blender.org/t/2021-12-23-animation-rigging-module-meeting/22042

> In #71435#1284453, @lichtwerk wrote: > Lets put it that way: *Should there be an undo push? Yes or No?* > I can see both behaviors be somewhat problematic. > If we add an undo push here, we'll get many undo steps by view rotation (possibly also leading to unwanted behavior when working with operators). > Or is the user expected to not use `Camera to View` in that case? > > Might be related to @BassamKurdali mentioning that autokey is not working in that scenario in https://devtalk.blender.org/t/2021-12-23-animation-rigging-module-meeting/22042

In #71435#1284453, @lichtwerk wrote:
Lets put it that way: Should there be an undo push? Yes or No?
I can see both behaviors be somewhat problematic.
If we add an undo push here, we'll get many undo steps by view rotation (possibly also leading to unwanted behavior when working with operators).

Good point. @mont29 is it possible to do an "undo push" only on the first camera motion, and then an "undo overwrite" (if there is such a thing) on subsequent movements?

> In #71435#1284453, @lichtwerk wrote: > Lets put it that way: *Should there be an undo push? Yes or No?* > I can see both behaviors be somewhat problematic. > If we add an undo push here, we'll get many undo steps by view rotation (possibly also leading to unwanted behavior when working with operators). Good point. @mont29 is it possible to do an "undo push" only on the first camera motion, and then an "undo overwrite" (if there is such a thing) on subsequent movements?
Member

@dr.sybren , maybe you're looking for ED_undo_grouped_push?

@dr.sybren , maybe you're looking for `ED_undo_grouped_push`?

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Yes, I think there should be undo push in case a camera is locked to the view, when transforming the view.

If we add an undo push here, we'll get many undo steps by view rotation (possibly also leading to unwanted behavior when working with operators).

Not sure I understand this, this is a modal operator right? So there should be only one undo step in the end, once the modal operation is validated. Of course if the user does ten different view rotation, there will be ten undo steps, but that's no different in the end that transforming the camera ten times in a row...

What may be difficult here is to only do the undo push when the camera is locked to the view, and not otherwise. Might need some changes to how we do undo step, and maybe a new callback in operator type (to say if there should be undo step or not)? @ideasman42 would probably know better here though.

Yes, I think there should be undo push in case a camera is locked to the view, when transforming the view. > If we add an undo push here, we'll get many undo steps by view rotation (possibly also leading to unwanted behavior when working with operators). Not sure I understand this, this is a modal operator right? So there should be only one undo step in the end, once the modal operation is validated. Of course if the user does ten different view rotation, there will be ten undo steps, but that's no different in the end that transforming the camera ten times in a row... What may be difficult here is to only do the undo push when the camera is locked to the view, and not otherwise. Might need some changes to how we do undo step, and maybe a new callback in operator type (to say if there should be undo step or not)? @ideasman42 would probably know better here though.
Member

@mont29 hi, did you see the patch {D15345}?

@mont29 hi, did you see the patch {[D15345](https://archive.blender.org/developer/D15345)}?

@PratikPB2123 no indeed.... would not have gone that way personally, but if Campbell is fine with it... Not sure why I got pinged on this task then though, guess @dr.sybren did not see the patch either. ;)

@PratikPB2123 no indeed.... would not have gone that way personally, but if Campbell is fine with it... Not sure why I got pinged on this task then though, guess @dr.sybren did not see the patch either. ;)

This issue was referenced by befe38fe1d

This issue was referenced by befe38fe1dfbbdac9ed9ef61853800426e5966c5

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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
11 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#92099
No description provided.