Maniphest T92099

No undo when moving viewport with camera locked to view
Closed, Resolved

Assigned To
Pratik Borhade (PratikPB2123)
Authored By
stib (stib)
Oct 11 2021, 1:41 AM
Tags
  • BF Blender
  • User Interface
  • Undo
Subscribers
bassam kurdali (bassamk)
Bastien Montagne (mont29)
Campbell Barton (campbellbarton)
Germano Cavalcante (mano-wii)
Julian Eisel (Severin)
Julien Kaspar (JulienKaspar)
kursad k (kursadk)
7 More Subscribers
Tokens
"Love" token, awarded by AndyCuccaro.

Description

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: rBa791bdabd0b2
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

Revisions and Commits

rB Blender
Closed

Event Timeline

stib (stib) created this task.Oct 11 2021, 1:41 AM
kursad k (kursadk) added a subscriber: kursad k (kursadk).EditedOct 11 2021, 3:34 AM

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

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Oct 29 2021, 4:56 PM
Philipp Oeser (lichtwerk) added a project: User Interface.
Philipp Oeser (lichtwerk) added subscribers: Julian Eisel (Severin), Bastien Montagne (mont29), Philipp Oeser (lichtwerk).

Quick talk to @Julian Eisel (Severin) and @Bastien Montagne (mont29) and (even though an edge case), can be confirmed, yes.

Campbell Barton (campbellbarton) mentioned this in P2674 Draft for Undo Documentation.Dec 20 2021, 7:43 AM
pan beep (beep) added a subscriber: pan beep (beep).Dec 30 2021, 11:10 AM

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.

Pratik Borhade (PratikPB2123) added a project: Undo.Jun 3 2022, 8:11 PM
Pratik Borhade (PratikPB2123) added a subscriber: Pratik Borhade (PratikPB2123).
Max Edge (bbbooo3) added a subscriber: Max Edge (bbbooo3).Jun 4 2022, 6:10 PM
Pratik Borhade (PratikPB2123) claimed this task.Jul 2 2022, 8:11 AM
Julien Kaspar (JulienKaspar) added a subscriber: Julien Kaspar (JulienKaspar).Jul 2 2022, 2:36 PM
Vitalii Vlasov (Fracture128) awarded a token.Jul 3 2022, 11:00 AM
Vitalii Vlasov (Fracture128) rescinded a token.
Philipp Oeser (lichtwerk) added subscribers: takaaki takeda (popqjp), Sybren A. Stüvel (sybren), bassam kurdali (bassamk) and 2 others.
In T71435#1284453, @Philipp Oeser (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 @bassam kurdali (bassamk) mentioning that autokey is not working in that scenario in https://devtalk.blender.org/t/2021-12-23-animation-rigging-module-meeting/22042

Sybren A. Stüvel (sybren) added a comment.EditedJul 12 2022, 12:33 PM
In T71435#1284453, @Philipp Oeser (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. @Bastien Montagne (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?

Pratik Borhade (PratikPB2123) added a comment.Jul 12 2022, 1:43 PM

@Sybren A. Stüvel (sybren) , maybe you're looking for ED_undo_grouped_push?

Bastien Montagne (mont29) added a subscriber: Campbell Barton (campbellbarton).Jul 14 2022, 12:54 PM

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)? @Campbell Barton (campbellbarton) would probably know better here though.

Pratik Borhade (PratikPB2123) added a comment.Jul 14 2022, 12:59 PM

@Bastien Montagne (mont29) hi, did you see the patch D15345: Fix T92099: No undo when moving viewport with camera locked to view?

Bastien Montagne (mont29) added a comment.Jul 14 2022, 2:13 PM

@Pratik Borhade (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 @Sybren A. Stüvel (sybren) did not see the patch either. ;)

Campbell Barton (campbellbarton) closed this task as Resolved by committing rBbefe38fe1dfb: Fix T92099: No undo when moving viewport with camera locked to view.Aug 6 2022, 4:58 AM
Campbell Barton (campbellbarton) added a commit: rBbefe38fe1dfb: Fix T92099: No undo when moving viewport with camera locked to view.
Campbell Barton (campbellbarton) mentioned this in rB8ed2abf856cb: Fix missing undo steps for smooth-view operators.Aug 9 2022, 1:33 AM
Andy Cuccaro (AndyCuccaro) awarded a token.Aug 17 2022, 11:27 PM