Page MenuHome

Fix T93759: Undo doesn't work with image type empty
Needs RevisionPublic

Authored by Pratik Borhade (PratikPB2123) on Jun 4 2022, 6:02 AM.

Details

Summary

Fix T93759.
Make an undo push in exit function on interaction with 2d cage gizmos
This will allow user to revert changes made with area light, images, etc.

Diff Detail

Repository
rB Blender

Event Timeline

Pratik Borhade (PratikPB2123) requested review of this revision.Jun 4 2022, 6:02 AM
Pratik Borhade (PratikPB2123) created this revision.
Pratik Borhade (PratikPB2123) planned changes to this revision.Jul 10 2022, 3:36 PM

I think it would be correct to make undo push in gizmo_cage2d_exit function. I'll change the patch

Campbell Barton (campbellbarton) requested changes to this revision.Aug 5 2022, 7:34 AM

Performing the undo push in the gizmos logic doesn't seem right as the gizmo could be used for any kind of data.

One way this could work is the GIZMOGROUP_OT_gizmo_tweak operator could undo when the wmGizmoProperty it's manipulating should be undone. See ui_but_is_rna_undo for checking if RNA should be undone. (This could become a shared function too if buttons and gizmos both use).

This revision now requires changes to proceed.Aug 5 2022, 7:34 AM

Hi, do you want me to add one struct member in wmGizmoProperty to make decision of undo push?
or just make undo push for particular wmGizmoProperty ("matrix" in this case)?


I think simple fix would be to make an undo push in gizmo_tweak_modal function.
Because most other gizmo types has operator with it so they don't call tweak_modal function (exiting early from invoke function due to gizmo_tweak_start_and_finish)