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.
Details
- Reviewers
Campbell Barton (campbellbarton) - Maniphest Tasks
- T93759: Undo doesn't work with image type empty
Diff Detail
- Repository
- rB Blender
Event Timeline
I think it would be correct to make undo push in gizmo_cage2d_exit function. I'll change the patch
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).
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)